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 The WordPress Template Hierarchy Page and Post Templates in WordPress Static Page Template Files

tarry nwaise
tarry nwaise
1,391 Points

I don't understand the answer for one of the questions on the quiz

There was a question on the quiz which was what is the fallback template for a static homepage. The correct anwers shows as page.php. Shouldn't it be index.php According to the Codex page hierarchy, this would be the page that would be used if front-page.php was not available.

2 Answers

Emma Willmann
seal-mask
.a{fill-rule:evenodd;}techdegree seal-36
Emma Willmann
Treehouse Project Reviewer

I can understand your confusion on this question, as sometimes understanding the wp hierarchy can be difficult. I use http://wphierarchy.com/ to look at the hierarchy, because I find it a little easier to read.

Starting on the left side, find 'Site Home Page' that leads to frontpage.php. It then breaks into two options, showing posts or a page. The question is asking about a static page, so follow the arrow up to 'Page Template' which leads to page.php as the fall back and the answer to this question. However, if page.php didn't exist, then index.php would be the fallback.

Hope that helps!

tarry nwaise
tarry nwaise
1,391 Points

Ok that makes sense.

Got it. I guess I thought the question was asking about the 'Site Home Page' that leads to frontpage.php.

Thanks!