Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

WordPress How to Make a Website with WordPress Customizing WordPress Themes How to Make Child Themes

Tim Crow
Tim Crow
1,251 Points

Child theme not showing Css (looks different to parent theme)

My child theme shows up on my wordpress, but when activating it. It only seems to show simple html layout. Why would this be? I've cleared my cache, copied the same coding as zac's style.css and inputted my personal folder data But still not working? any ideas?

1 Answer

Zac Gordon
STAFF
Zac Gordon
Treehouse Guest Teacher

What theme are you trying to create a child theme for?

You may have to create a functions.php file in your theme and add the following code:

<?php 

function enqueue_theme_style() {
    wp_enqueue_style( 'child-style', get_stylesheet_directory_uri() . '/style.css' );
}
add_action( 'wp_enqueue_scripts', 'enqueue_theme_style' );

?>
Debby Beachy
Debby Beachy
Courses Plus Student 2,096 Points

Hi Zac I've been following along with the tutorials and all is great so far. I'm using the theme in the video twenty thirteen, but after researching farther the @import tag is not the best practice and is outdated. It seems with the @import tag if the parent theme updates the child styles will not update with it causing problems. I was told this php file shown above would take care of this problem. Is this true?
And I"m not sure how I'm to create a functions.php file in my theme and upload it in the right place.

Do have a step by step tutorial on how this is done so I will not blow up this test blog? After searching all day I can come up with the code, but not the "How To". Thanks