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 trialBrittany Cerra
7,424 PointsClosing 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
Nora Demirjian
7,160 PointsBecause 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!
Crisoforo Gaspar Hernández
18,302 PointsBecause 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
7,424 PointsThank 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.
Brittany Cerra
7,424 PointsBrittany Cerra
7,424 PointsThat makes sense! Thank you.