• Resolved Aaron

    (@jstask)


    I am developing a theme, and it is adding

    
    <style id='core-block-supports-inline-css' type='text/css'>
    /**
     * Core styles: block-supports
     */
    
    </style>

    inside the body through wp_footer() which is called one line above </body>

    How can I remove this style tag?

    Why is it doing so? Style tags don’t belong to the body, it is invalid HTML.`

    • This topic was modified 2 years, 4 months ago by Aaron.
Viewing 8 replies - 1 through 8 (of 8 total)
  • Simplest methode would be to disable SCRIPT_DEBUG in wp-config.php like this:

    define( 'SCRIPT_DEBUG', false );

    Thread Starter Aaron

    (@jstask)

    Thanks a lot! I never thought of it being put in because of debugging.

    This does not work for me.
    I have set define( ‘SCRIPT_DEBUG’, false ) in the config, but the style tags still remain.

    <style>.wp-block-gallery.wp-block-gallery-2{ --wp--style--unstable-gallery-gap: var( --wp--style--gallery-gap-default, var( --gallery-block--gutter-size, var( --wp--style--block-gap, 0.5em ) ) ); gap: var( --wp--style--gallery-gap-default, var( --gallery-block--gutter-size, var( --wp--style--block-gap, 0.5em ) ) )}</style>
    <style id='core-block-supports-inline-css' type='text/css'>
    .wp-block-columns.wp-container-6{flex-wrap:nowrap;}
    </style>
    </div>
    </div>
    </body>
    </html>

    The styles of the gallery block are also there.

    Any Idea?

    Thank you!

    • This reply was modified 2 years, 4 months ago by syntcom.

    Tried it with a fresh install again. And it works as expected.
    Seems to be caused by the theme or a plugin. No need to investigate this any further.

    I have the same issue (WordPress 6.1.1). It seems to be a problem with the theme which comes from one.com. Can anyone suggest any solution?

    The inline CSS with “core-block-supports-inline-css” ID only appears on the homepage.

    I’ve checked the theme’s files, and it seems it only checks “SCRIPT_DEBUG” constant, but never try to define it.

    Any ideas what can fire this CSS up?

    add_action('wp_footer', function () {
        wp_dequeue_style('core-block-supports');
    });

    Awesoome! The only approach that really works. Thank you @vguerrerobosch.

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘core-block-supports-inline-css’ is closed to new replies.