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 trialJose Estrada
1,551 PointsWhy 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
15,622 PointsHi 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
Jose Estrada
1,551 PointsJose Estrada
1,551 PointsThanks 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
15,622 PointsHugo Paz
15,622 PointsCan you post your style.css and functions.php code?
Jose Estrada
1,551 PointsJose Estrada
1,551 Points/* 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
15,622 PointsHugo Paz
15,622 PointsHi Jose,
Did you activate the child theme in the admin area?
Jose Estrada
1,551 PointsJose Estrada
1,551 PointsHi! 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
15,622 PointsHugo Paz
15,622 PointsDid you change anything in the original theme?
Jose Estrada
1,551 PointsJose Estrada
1,551 PointsNopes... nothing at all... I'm really puzzled here...
Hugo Paz
15,622 PointsHugo Paz
15,622 PointsTry activating the regular theme. delete the child theme folder and start again.
Jose Estrada
1,551 PointsJose Estrada
1,551 PointsThanks 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!