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 trialMichael Hampshire
12,206 PointsWhy is that only some of my CSS works in Wordpress?
I'm currently trying to learn WordPress. I know how to link a child theme and do some editing there but when I save the changes, only some of the CSS works. Why is that? I've watched some of the WordPress videos here on the site, but are there any other recommended courses I take?
This is the CSS I have on my website:
/* Theme Name: Simpleshift Child Author: Michael Hampshire Template: simpleshift version: 1.0.8 */
@import "../simpleshift/style.css";
.banner-title { color: blue; }
.btn-simpleshift { background-color: blue; }
The only thing that changes is the banner title which turns from white to blue. But the button background only stays orange (its original color). Any help or advice would be awesome!
Thanks, Mike
1 Answer
Brian Jensen
Treehouse StaffCan you please post your wp_enqueue_style's from the functions.php of your child theme?
Michael Hampshire
12,206 PointsMichael Hampshire
12,206 PointsMaybe this is apart of the problem. When I make a child theme, do I need to include all of the .php files? All I have in the theme folder now is the style.css file?
Jacob Mishkin
23,118 PointsJacob Mishkin
23,118 PointsI agree with Brian Jensen it's best practice to create a functions.php file and then enqueue both parent and child theme styles.
here is a sold example on how to set that up: enqueue styles
What do you mean by all of your files? for a child theme you need a style.css and a functions.php file to enqueue both parent and child theme styles. you only include files to your child theme folder if you are creating new files, or overwriting files from the parent theme.