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 trialoren tal
5,738 Pointsi tried all the suggestions below and it still doesn't work!
So the child theme successfully made. also the style.css and the function.php files are the same as it should be. i also log off and on from the wp user and cleared browser data. it still doesn't applied the changes in the style od the child theme...
what can it be?
4 Answers
Jonathan Grieve
Treehouse Moderator 91,253 PointsWhat changes are you trying to make specifically to your child theme?
To test that the theme is specifically picking up the files for your child theme, try echoing out a string to the screen using something like
echo "Test!!!";
If it appears, then your child theme is working.
Also try and make sure you're selecting the right elements for the changes you want to make in your style.css.
Good luck! :)
oren tal
5,738 Points<?php
// Remove WP Version From Styles
add_filter( 'style_loader_src', 'sdt_remove_ver_css_js', 9999 );
// Remove WP Version From Scripts
add_filter( 'script_loader_src', 'sdt_remove_ver_css_js', 9999 );
// Function to remove version numbers
function sdt_remove_ver_css_js( $src ) {
if ( strpos( $src, 'ver=' ) )
$src = remove_query_arg( 'ver', $src );
return $src;
}
?>
and
/*
Theme Name: Twenty Fifteen
Theme URI: https://wordpress.org/themes/twentyfifteen-child/
Author: the WordPress team
Author URI: https://wordpress.org/
Description: Our 2015 default theme is clean, blog-focused, and designed for clarity. Twenty Fifteen's simple, straightforward typography is readable on a wide variety of screen sizes, and suitable for multiple languages. We designed it using a mobile-first approach, meaning your content takes center-stage, regardless of whether your visitors arrive by smartphone, tablet, laptop, or desktop computer.
Version: 1.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Tags: black, blue, gray, pink, purple, white, yellow, dark, light, two-columns, left-sidebar, fixed-layout, responsive-layout, accessibility-ready, custom-background, custom-colors, custom-header, custom-menu, editor-style, featured-images, microformats, post-formats, rtl-language-support, sticky-post, threaded-comments, translation-ready
Text Domain: twentyfifteen
Template: twentyfifteen
This theme, like WordPress, is licensed under the GPL.
Use it to make something cool, have fun, and share what you've learned with others.
*/
@import "../twentyfifteen/style.css";
.navbar {
background-color: #220e10;
}
Luke Pettway
16,593 PointsWhat is your folders name for the child theme? Also, your text domain should be twentyfifteen-child.
Jessica Orellanes
11,245 PointsThis is how i solved it.
for the style.css
/*
Theme Name: Twenty Thirteen Child
Theme URI: http://jessorellanes.com/twenty-thirteen-child/
Description: Twenty Thirteen Child Theme
Author: Jessica Orellanes
Author URI: http://jessorellanes.com
Template: twentythirteen
Version: 1.0.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: twenty-thirteen-child
*/
.navbar {
background-color: #220E10;
}
.nav-menu li a {
color: #FFFFFF;
}
and then on functions.php
<?php
function theme_enqueue_styles() {
$parent_style = 'parent-style';
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 )
);
}
add_action( 'wp_enqueue_scripts', 'theme_enqueue_styles' );
?>
Thanks to another student I've found the info in Child Themes It looks like Wordpress updated their best practices for this and @import is no longer need it. You have to include the php file as they explain.
Konrad Pilch
2,435 PointsKonrad Pilch
2,435 PointsCan be something wrong in your functions or somthign? could you past your code in few areas please?