[wp-hackers] Safe location for "fallback" theme

Stephen Rider wp-hackers at striderweb.com
Tue Apr 20 19:03:56 UTC 2010


Hi --

I came across an issue today, and after finally figuring out the problem I thought I'd run this past y'all.  Needs a code fix, IMO.

I installed a new WordPress site, went into admin and started configuring settings.  After a bit I popped over to the main site URL to see how it was all looking.

Blank page.

Huh.  That's weird.  I thought it might be something to do with my putting the WordPress files in their own directory, so I monkeyed with that for a while.  No dice.  Checking database settings, the SiteURL setting, etc.  No luck.

Finally I discovered that the problem was that the "default" theme was not in the theme directory (long story short: there was a filter set in the FTP program).  The site was set to "Default" theme, but the theme was missing.  Because "Default" is the fallback theme if a theme is missing, it was falling back on its own nonexistent self and thus showing a blank page.

I have a plugin that makes pull-quotes, and in coding the "style" functionality therein, I came across the same issues regarding fallback, and here is the solution that I finally implemented there:

1) Theme directory has default theme and whatever else comes with the system.

2) A complete second copy of the default theme exists in a completely different location not likely to be modified by user (/wp-includes perhaps?)

3) The "hidden" copy is the ultimate fallback.  If a selected theme is missing, fall back to the "default" in the theme directory.  If THAT is missing, fall back to the hidden "safe copy" of the default theme.

I can readily see a site owner removing the default theme, and then being lost if there is a problem with the theme he's using.  I think this would be a worthwhile addition to the core.

What say you all?

Stephen Rider

P.S. the pull-quote plugin:  http://striderweb.com/nerdaphernalia/features/wp-javascript-pull-quotes/


More information about the wp-hackers mailing list