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 Customizing the WordPress Admin Area Admin Color Schemes Customizing Admin Color Schemes from Scratch

Stavros Sofroniadis
PLUS
Stavros Sofroniadis
Courses Plus Student 1,503 Points

Why php file in the begining was empty?

In a video tutorial https://teamtreehouse.com/library/customizing-the-wordpress-admin-area/admin-color-schemes/customizing-admin-color-schemes-from-scratch

he mentioned that php was empty in child theme and afterwards he copy-paste code inside.

If you could explain why php was empty and afterward place code inside?

Thank You,

Luis Felipe Lino
seal-mask
.a{fill-rule:evenodd;}techdegree
Luis Felipe Lino
Full Stack JavaScript Techdegree Student 15,708 Points

I don't know If I understood your question correctly but let's try.

If you're talking about the functions.php file, it was empty at first because it didn't have functionalities to manage. When Zac Gordon paste the code it's because that code is necessary to make the different colors schemes works in the admin panel.

Stavros Sofroniadis
Stavros Sofroniadis
Courses Plus Student 1,503 Points

Thanks for reply

In the example Zac worked with child theme, php file was empty in the begining. It was possible this theme to work (if activated as a theme) with empty php code?

The role of php code Zac used, is to say to WordPrees to load css style(Treehouse) into WordPress as an option?

2 Answers

Luis Felipe Lino
seal-mask
.a{fill-rule:evenodd;}techdegree
Luis Felipe Lino
Full Stack JavaScript Techdegree Student 15,708 Points

In the example Zac worked with a child theme, the PHP file was empty in the begining. It was possible this theme to work (if activated as a theme) with empty php code?

The child theme will work even if the functions.php file is empty. This is because it inherits the functionalities from the main theme, so you just need to add code to new functionalities.

The role of php code Zac used, is to say to WordPrees to load css style(Treehouse) into WordPress as an option?

Yes. And then treehouse colors scheme shows up as an option inside the admin panel.