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 Build a WordPress Theme Preparing to Code WordPress Templates Adding Titles and Meta Tags

Brittany Cerra
Brittany Cerra
7,424 Points

Closing the body tag in the footer.

Why do we close the body tag in the footer file and not the index.php file?

2 Answers

Because the footer is not only displayed in the index file but on other pages as well like pages that have posts or singe post pages. Hope that helped! Good luck!

Brittany Cerra
Brittany Cerra
7,424 Points

That makes sense! Thank you.

Crisoforo Gaspar Hernández
Crisoforo Gaspar Hernández
18,302 Points

Because all the files for example header.php footer.php are called by index.php so when you write the tag: <?php get_footer(); ?> you are calling all the code inside the file footer.php.

Brittany Cerra
Brittany Cerra
7,424 Points

Thank you for the response! I get the includes, but I was confused as to why this closing tage wouldn't just be included in what seems like the lowest common denominator--the index.php. I forgot that there are pages that aren't drawn from the index file.