Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

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

share|improve this question

migrated from stackoverflow.com Jul 2 '11 at 18:01

This question came from our site for professional and enthusiast programmers.

    
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
    
@silent thank you very much. Its working :) –  Giri Jun 29 '11 at 10:10

1 Answer 1

up vote 1 down vote accepted

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.

share|improve this answer

Your Answer

 
discard

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.