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 WordPress Customizer API Native WordPress Customizer Settings Custom Header Images, Colors and Display Text Option

Ulises Calvo
Ulises Calvo
2,233 Points

So it is a good practice to inline that CSS?

Just wondering, I have seen forums in which they mention creating a css.php file, what would be a better practice?

3 Answers

Typically you will load stylesheets externally, as it makes your document smaller. There is an argument for inlining critical CSS in your header, which is anything that would be within the window on load. For most sites though stick to loading in your style.css like normal.

Ulises Calvo
Ulises Calvo
2,233 Points

Zac creates a <styles> tag withing the functions.php with some CSS in it in order to display the styles for the header text and disappear the header text when the checkbox is clicked in the customizer. I in my case had to write a whole bunch of CSS declarations to achieve the results that I needed to style my header text. That is why I asked that question, it feels like to much CSS to be written in a functions.php file. But I'm just learning, maybe that is the customary thing to do. Thank you Luke.

Leroy Sibisi
Leroy Sibisi
20,619 Points

Having an external style sheet, your work will be more presentable and easy to read.

Ulises Calvo
Ulises Calvo
2,233 Points

That's what I thought... :)

Konrad Pilch
Konrad Pilch
2,435 Points

What do you mean css.php file?

I only know that if your making a WP theme you can use inline CSS for things such as images since you can't modify CSS with WP , so any image will be off the road.

If you style background: path .. you can do it inline with CSS when doing WordPress stuff.

Ulises Calvo
Ulises Calvo
2,233 Points

Actually they call it layout.php . I think I would stick to what Zac does on this lesson. Thank you Konrad.