• Resolved prosperot

    (@prosperot)


    My CSS snippet stoped working. I was using this:

    add_action( 'wp_head', function () { ?>
    <style>
    .header-filter::before { background-color: rgba(0,0,0,0.10); }
    </style>
    <?php } );

    But strangely it does work when I include it in Customizer/Extra CSS:
    .header-filter::before { background-color: rgba(0,0,0,0.10); }

    Using the latest versions of theme (Hestia) and WordPress

    • This topic was modified 4 years, 9 months ago by prosperot.

    The page I need help with: [log in to see the link]

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Shea Bunge

    (@bungeshea)

    I imagine this might be because the CSS snippet is being loaded before the theme CSS.

    Try having it load a little later instead:

    add_action( 'wp_enqueue_scripts', function () { ?>
    <style>
    .header-filter::before { background-color: rgba(0,0,0,0.10); }
    </style>
    <?php }, 25 );
    Thread Starter prosperot

    (@prosperot)

    Thanks for your reply, but your suggestion does not work.

    I guess I just add the extra css via the theme itself.

    Plugin Author Shea Bunge

    (@bungeshea)

    Sure, if you’re happy with that.

    Otherwise, if you want to debug further: can you see the CSS code from the snippet when you view the source code of your site’s homepage?

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘CSS snipet does not work’ is closed to new replies.