• So it’s not often when i’m getting to work with some nasty coded themes and right now i’m using one, that uses multiple stylesheet files and every setting in theme option(colors, backgrounds etc.) are set with !important rule. Sure, it works, but if theme itself using !important to overwrite it’s own styles, then something is off(at least in my opninion).

    Right now i’m using child theme for my own customizations and i have problem with child css – i need to patch almost every style with !important, which makes a tens of lines with something i don’t like to do. Is there some kind of good way to prioritize child theme css over parent? I know, that it should do it by default, but that’s not the case.

    Code i’m using to call for stylesheets right now:

    add_action( 'wp_enqueue_scripts', 'theme_enqueue_styles', PHP_INT_MAX);
    
    function theme_enqueue_styles() {
        wp_enqueue_style( 'parent-style', get_template_directory_uri() . '/style.css' );
        wp_enqueue_style( 'child-style', get_stylesheet_directory_uri() . '/style.css', array( 'parent-style' ) );
    }

    Would appreciate any help in that matter. Yes, i have tried cleaning cookies etc.

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)

The topic ‘Prioritizing child CSS’ is closed to new replies.