0

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?

2
  • I don't recall seeing that happen before. What Theme are you using? What Plugins do you have active? May 21 '12 at 13:18
  • My own theme. No active plugins.
    – Scott B
    May 21 '12 at 16:43
1

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"

2
  • 1
    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. 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 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.