Hey guys i recently created a theme. I want to show home.php when a visitor visit home page but all my blog posts are listed in index.php file. Can someone suggest me how to display index.php i tried http://www.mysiteurl.com/index.php but it redirecting me to http://www.mysiteurl.com/home.php Please advise me. Thanks

  • There's no reason you can't use the code from index.php in home.php. – ceejayoz Jun 29 '11 at 3:25
  • Well i'm not trying to use same code. If i rename the home.php file to xxx.php then it calls index.php file. But i need both pages. I mean home.php as index page. I created a nav menu and placed link called blog. When the user click blog link then i wanna show index.php there. This is what i need. By the way thanks for your comment – Giri Jun 29 '11 at 3:49
  • 3
    if you have home.php as your home page, you can't have index.php as sub page. However, you can have index.php has your home page and blog.php as blog page – ariefbayu Jun 29 '11 at 8:12

You're misunderstanding the purpose of home.php, which is not necessarily to output the Site Front Page, but rather to output the Blog Posts Index.

In WordPress, the index.php is simply the default fallback template file, that is used when no other, more-specific template file is available.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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