Stylesheets not overriding one another correctly
-
I am trying to enqueue stylesheets so that I have extra code for a particular category of pages:
function theme_enqueue_scripts() { wp_enqueue_style( 'parent-style', get_template_directory_uri() . 'style.css' ); wp_enqueue_style( 'twentysixteen-style', get_template_directory_uri() . '/style.css' ); wp_enqueue_style( 'child-style', get_template_directory_uri() . 'style.css' ); if ( in_category( 'poem' ) ) { wp_enqueue_style( 'poem-style', get_stylesheet_directory_uri() . '/poemstyle.css' ); } } add_action( 'wp_enqueue_scripts', 'theme_enqueue_scripts' );When I look in the dev console, the poemstyle.css is queued last, as it should be.
However, the styles in this stylesheet are being overridden by the styles in style.css, unless I add ‘!important’ to them.
What do I do now to give poemstyle.css priority?
The page I need help with: [log in to see the link]
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
The topic ‘Stylesheets not overriding one another correctly’ is closed to new replies.