• Resolved devvvector

    (@devvvector)


    I have added CSS to header but the code is CSS is appearing in body instead of header.
    Tried both Code Snippets and Global Header and Footer but still no luck.

    The wordpress version is 6.4.1

    • This topic was modified 2 years, 4 months ago by devvvector.
Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Mircea Sandu

    (@gripgrip)

    Hi @devvvector,

    It sounds like you have to switch the Code Type of the snippet to “CSS” from the Code Type picker on the top right of the snippet editor.

    If you are using a HTML snippet or adding using Global Header & Footer you will need to wrap your CSS code in style tags.

    Thread Starter devvvector

    (@devvvector)

    Hi @gripgrip

    Thanks for your reply.

    I have tried both of your suggestion but still no luck.
    I’m sure it was working before I have done wordpress or the plugin update

    Tested it with a simple css

    <style>
    body {background-color: powderblue;}
    h1 {color: blue;}
    p {color: red;}
    </style>

    View post on imgur.com

    View post on imgur.com

    • This reply was modified 2 years, 4 months ago by devvvector.
    • This reply was modified 2 years, 4 months ago by devvvector.
    Plugin Author Mircea Sandu

    (@gripgrip)

    Hi @devvvector,

    Thank you for the details – that’s weird – are you using any performance optimization plugins that may be moving styles around to make the page load faster? That’s the only thing I can think of making this change, if the wp_head hook would be called in the body you would see everything else from head there so there must be something moving just the style tag.

    Thread Starter devvvector

    (@devvvector)

    Hey @gripgrip

    I can finally spot out the plugin that causing the problem.
    Thank you for your reply!!

    • This reply was modified 2 years, 4 months ago by devvvector.
Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘CSS added to header is appearing in body’ is closed to new replies.