Error Enqueing child theme stylesheets
-
Hi, I’m trying to create and use a child theme.
I created the “themeName-child” folder
I created a stylesheet “style.css as written in the documentation.After activating the child theme i have create the function.php file.
To load the parent stylesheet i put the following code in the function.php of the child theme folder:<?php add_action ('wp_enqueue_scripts', 'my_plugin_add_stylesheet'); function my_plugin_add_stylesheet () { wp_enqueue_style ('my-style', get_stylesheet_directory_uri (). '/style.css', false, '1.0', 'all'); }
I also tried this:
<?php add_action ('wp_enqueue_scripts', 'my_theme_enqueue_styles'); function my_theme_enqueue_styles () { $ parent_style = 'parent-style'; // This is 'twentyfifteen-style' for the Twenty Fifteen theme. 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), wp_get_theme () -> get ( 'Version') ); }
The parent stylesheet isnt loaded.
What am I doing wrong?
Thank you
Viewing 13 replies - 1 through 13 (of 13 total)
Viewing 13 replies - 1 through 13 (of 13 total)
- The topic ‘Error Enqueing child theme stylesheets’ is closed to new replies.