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

Why does my child theme won't overwrite the original?

I did everything the video says, but with the "albar" theme but it won't change anything on my site. I tried both, the color changing and the comment removal and nothing... any ideas?

1 Answer

Hugo Paz
Hugo Paz
15,622 Points

Hi Jose,

Its no longer recommended to use @import to connect the style from the parent theme with the child theme.

You need to follow these instructions

Thanks for the reply... I just tried that and didn't worked... I removed the @import and created the functions.php with the code they suggested and nothing happened

Hugo Paz
Hugo Paz
15,622 Points

Can you post your style.css and functions.php code?

/* Theme Name: Albar Child Theme URI: http://kairaweb.com/theme/albar/ Description: Child theme for the Albar theme Author: Jose Estrada Author URI: http://westgar.com/ Template: albar Version: 1.5.8:894 */

.site-top-bar { background-color: #8D9095; color: #FAFAFA; }


<?php add_action( 'wp_enqueue_scripts', 'theme_enqueue_styles' ); function theme_enqueue_styles() { wp_enqueue_style( 'parent-style', get_template_directory_uri() . '/style.css' );

}

Hugo Paz
Hugo Paz
15,622 Points

Hi Jose,

Did you activate the child theme in the admin area?

Hi! yes I did, now this appears:

Fatal error: Call to undefined function kaira_theme_option() in /home/westgarc/public_html/wp-content/themes/albar/header.php on line 9

Hugo Paz
Hugo Paz
15,622 Points

Did you change anything in the original theme?

Nopes... nothing at all... I'm really puzzled here...

Hugo Paz
Hugo Paz
15,622 Points

Try activating the regular theme. delete the child theme folder and start again.

Thanks I'll do that, I'll let you know how it goes... I'm gonna do it carefully this time so, maybe tomorrow... Thanks for the help!