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

William Albertson
William Albertson
5,210 Points

How to use the @import function in CSS?

I am trying to create the child theme and have the @import as the only piece on my CSS. I can create the child theme but I can not figure out how to have the @import function in there which makes the customization so much easier. PLZ help me!

1 Answer

Mark Josephsen
Mark Josephsen
8,803 Points

Ensure that you have added a new folder here:

public_html / wp-content / themes

Have your folder name the same as your theme name but add this to the end of the name:

_child

So, if my theme was named 'blah', the folder would be named 'blah_child'.

Now, put your css file in there. Ensure that it is named:

style.css

In keeping with the 'blah' example, the first executable line in that file should be

@import "../blah/style.css";

Hope this helps!