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 trialAwais jamil
Java Web Development Techdegree Student 4,742 PointsChild theme has lots of text in it and in the video it's online has @import /../twentythirteen/style.css"; how to i doit
i am having trouble making child theme it makes but on the wordpress it says no template available ? how can i change it please help
1 Answer
Brian Hayes
20,986 PointsYou'll have to get more specific I think to get a more specific answer... but I'll try and go over child themes real quick as i think it may apply to what you're trying to ask.
All a child theme technically requires is a directory and a style.css
file with the proper comment meta pointing to the parent theme.
So for a child theme of the Twenty Fifteen parent theme you would need a directory called twentyfifteen-child
or something like that, and then the comment in the style.css
would require, at the bare minimum:
/*
Theme Name: Twenty Fifteen Child
Themplate: twentyfifteen
*/
The codex says that you should also include a functions.php
file as well, but you don't have to have anything in it if you don't need to.
Now, that @import
is in the stylesheet so as to bring in the stylesheet from the parent theme. This is because, with the child theme activated, the style.css
file that is used by WordPress is no longer the one from the parent theme, but the one from the child theme. So by importing the stylesheet from the parent theme, you get all of the styles without any copying and pasting.
For a more in depth look at Child Themes, check out the WordPress Codex page concerning Child Themes.
A Final Note: The complexity of a child theme can vary greatly, so it is quite possible that some have a lot more code than others. Some child themes are just some extra CSS styles that modify or extend the parent, while others include all kinds of new styles as well as templates and functions.
The Genesis Framework set up is a great example of employing child themes that have a lot of code to theme.