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 trialjoeboo2529
9,805 PointsSo what's the differences between index.php, head.php and home.php then? can someone please explain this to me? Thank yo
differences between index.php, head.php and home.php
1 Answer
Rich Bagley
25,869 PointsHi Joe,
A brief summary would be:
- index.php is the default fall back file.
- home.php is used for posts as part of a blog.
- head.php isn't a default file but if you're referring to header.php this is where the head tags and any header elements are added. It can be included via a page such as index.php using get_header().
Although a little old, this post from the WordPress Stack Exchange has a more in depth answer.
I'd recommend looking over the WordPress Template Hierarchy site along with the following:
- This section of the WordPress Development course for home page templates
- This section of the WordPress Development course for the header and footer files.
Hope that helps :)
-Rich