Importing parent theme stylesheet to child theme
-
Hi everyone, I’m creating a child theme for the theme I’m currently using (Hueman)
I want to import the parent theme stylesheet. I read there are two ways to do that:- Via the @import method
- Via the wp_enqueue_style() function
I heard the second method is better than the first (is it true?), so I created a file called functions.php in my child theme folder and added the following code:
<?php add_action( 'wp_enqueue_scripts', 'enqueue_parent_theme_style' ); function enqueue_parent_theme_style() { wp_enqueue_style( 'parent-style', get_template_directory_uri().'/style.css' ); }The problem is that it’s not working. Can you tell me how to fix this? If not can I use the @method import or is it unpreferable?
Thanks in advance
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
The topic ‘Importing parent theme stylesheet to child theme’ is closed to new replies.