Title: How does index.php differ from pages.php
Last modified: August 19, 2016

---

# How does index.php differ from pages.php

 *  [charles_i](https://wordpress.org/support/users/charles_i/)
 * (@charles_i)
 * [16 years, 11 months ago](https://wordpress.org/support/topic/how-does-indexphp-differ-from-pagesphp/)
 * Still curious about how WordPress treats an index.php file versus a page.php 
   file. As far as I can tell, in a simple theme there is no page.php file so the
   loop is in index.php and runs every page on the site.
 * In a more advanced theme there is an index.php file and a page.php file. From
   experimenting it appears that:
 *  – index.php is needed to make the Theme appear in the Dashboard
    – the content
   on this page is what you will see if you click on the Theme title in the Dashboard&
   in preview – otherwise pages.php displays content on the website
 * Is this correct? If so, it seems redundant to have a separate page.php file.
 * Thanks
    Charles

Viewing 2 replies - 1 through 2 (of 2 total)

 *  [asechrest](https://wordpress.org/support/users/asechrest/)
 * (@asechrest)
 * [16 years, 11 months ago](https://wordpress.org/support/topic/how-does-indexphp-differ-from-pagesphp/#post-1090159)
 * Review [Stepping Into Templates](http://codex.wordpress.org/Stepping_Into_Templates)
   and the [template hierarchy](http://codex.wordpress.org/Template_Hierarchy).
 * It’s not redundant. Consider the extremely common scenario where you want a WordPress
   Page to display differently than the homepage. In this case, the template system
   automatically looks to `page.php`. If there is no `page.php`, it falls back on`
   index.php`, which is much more desirable than simply having the website break
   if it can’t find `page.php`.
 *  Thread Starter [charles_i](https://wordpress.org/support/users/charles_i/)
 * (@charles_i)
 * [16 years, 11 months ago](https://wordpress.org/support/topic/how-does-indexphp-differ-from-pagesphp/#post-1090163)
 * OK thanks. So if index.php is the only page it will display every page, but if
   there is a page.php for all other pages, index.php will display the home page–
   like a regular (non-blog) website. So, is the page specified in Blog address (
   URL) (in Settings) what determines what will appear in index.php? You couldn’t
   just determine it with just the name “home” in Pages.

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘How does index.php differ from pages.php’ is closed to new replies.

 * 2 replies
 * 2 participants
 * Last reply from: [charles_i](https://wordpress.org/support/users/charles_i/)
 * Last activity: [16 years, 11 months ago](https://wordpress.org/support/topic/how-does-indexphp-differ-from-pagesphp/#post-1090163)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
