Replace a stylesheet via function.php in child theme
-
Hi fellow coders,
In the parent theme, a stylesheet is loaded in function.php via
wp_enqueue_style( 'layout', 'stylesheets/layout.css' );I would like to replace this file with my own layout.css in child theme folder (I already tried simply adding the relevant styles to my child’s style.css but this didn’t do anything).
My approach is:
function child_enqueue_style() { wp_dequeue_style( 'layout' ); wp_enqueue_style( 'layout_child', 'stylesheets/layout.css' ); } add_action( 'init', 'child_enqueue_style', 11 );Note that the second layout.css is the one in a sub directory of my child theme.
However it is still only loading the original layout.css.
Any idea what to do?
Thanks!
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
The topic ‘Replace a stylesheet via function.php in child theme’ is closed to new replies.