0

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

3
  • There's no reason you can't use the code from index.php in home.php.
    – ceejayoz
    Commented Jun 29, 2011 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 Commented Jun 29, 2011 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
    Commented Jun 29, 2011 at 8:12

1 Answer 1

1

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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