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

When viewing my theme files via "Appearance > Editor", the index.php file that's listed there is an index.php that's inside a subfolder of my theme directory, not the main index.php file that resides in the root of my theme folder.

How can I tell WP to list my theme's index.php there?

share|improve this question
I don't recall seeing that happen before. What Theme are you using? What Plugins do you have active? – Chip Bennett May 21 '12 at 13:18
My own theme. No active plugins. – Scott B May 21 '12 at 16:43
up vote 1 down vote accepted

I've found the problem. I had placed an empty index.php file into a subdirectory folder under my main theme folder to prevent directory browsing on that folder.

The presence of this index.php was causing the wordpress file editor to assume it was the default index.php for my theme.

Renaming that file to home.php has resolved the problem and the file editor now properly loads my theme's index.php file as the "Main Index Template"

share|improve this answer
Just a note: naming that file home.php may cause unintended problems. That filename is reserved as part of the Template Hierarchy. There's actually no need for such a file in the first place. Just use .htaccess to prevent directory browsing. – Chip Bennett May 21 '12 at 18:08
Don't prevent directory browsing with index.php files and the like. Just add "Options -Indexes" to the top of your main .htaccess file instead. Voila, no directory browsing on the whole site. Alternatively, use index.html files instead, if you do need directory browsing somewhere else on the site. – Otto May 21 '12 at 21: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.