Notice: These forums are now retired and closed. For active support, please Submit a Ticket or visit our official WordPress.org community pages.
Kadence Theme | Kadence Blocks | Starter Templates | WooCommerce Email Designer | Ascend | Virtue | Pinnacle

Correctly enqueuing CSS with Highest priority

Home / Forums / Kadence Theme / Correctly enqueuing CSS with Highest priority

This topic is: Resolved
[Resolved]
Posted in: Kadence Theme
November 28, 2025 at 4:51 pm

Hi,

Hi,

Is there a better code for enqueuing CSS in the child theme to prevent the parent theme’s CSS from overriding the child theme’s CSS?
I always have to use a lot of “!important” in the child CSS, which is not good for website optimization. If I can avoid this “!important”, it will be great.

I am currently using this enqueuing code:

function child_enqueue_styles() {
wp_enqueue_style( 'child-theme', get_stylesheet_directory_uri() . '/style.css', array(), 100 );
}

add_action( 'wp_enqueue_scripts', 'child_enqueue_styles' );

Is there a more efficient code that allows the child CSS to take priority over the parent theme CSS?

Thanks!

  • The forum ‘Kadence Theme’ is closed to new topics and replies.