WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

This may sound like a stupid / noob question. But I'm curious to wonder as to why you can't insert the wordpress php loop functions outside into say a blog.php file but you can in a index.php file?

For instance, when I try running all the loop code in say a blog.php file, and linking the pages up nothing shows. I've tinkered with the reading settings as well just to make sure nothing is off. However, when I move the loop php code into an index.php file the blog page will then display the pages.

Am I missing something, or is there a way to insert the loop into a different .php file instead of the index?


share|improve this question
up vote 1 down vote accepted

That's because of the Template Hierarchy WordPress uses. The blog.php you're trying to use isn't part of the default templates WordPress uses.

share|improve this answer
Thanks! I'll have to fiddle around with the codex a little more :) – Monstr92 Sep 24 '12 at 19:23

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.