Feb
23
2009

Why Certain Themes Won’t Preview Properly in WordPress

by   |  Posted in Tutorials  |  5 comments

I have been developing some themes for WordPress and I couldn’t understand why they wouldn’t appear in the preview when they were selected. I went through all of my code and tested removing parts that I thought might be the cause and no luck. Luckily enough I stumbled upon WP Contempo and found a solution.

They state that WordPress does not like spaces in their theme folders. So something like “magazine basic” won’t do it. But what I also noticed, was that “magazine-basic” won’t do it either. The only way to name a folder so that the WordPress preview works properly is to use the underscore. So something like “magazine_basic” works perfectly.

About the author:

A freelance web developer living in Montreal who spends most of his time writing for this site and building Premium themes for WordPress. You can find him on Twitter @bavotasan.

Site5 Affiliate Link
If you liked this, please share it.

Tags: , , , , , , , , , , ,

Short URL: http://bit.ly/bQ6Ali

Discussion 5 Comments

  1. K. Praslowicz on March 13, 2009 at 11:20 pm

    Thanks for this. I had a development skin named with hypens that suddenly stopped working and it was confusing me very badly. Changing to underscores fixed it up.

    This a 2.7.1 issue? I never noticed the preview not working until tonight. All my devlopment on 2.7.0 with the hyphens worked fine.

    • c.bavota on March 16, 2009 at 5:31 pm

      I only noticed it with 2.7 but I can’t say for sure that it did not occur in 2.6.

  2. purple on April 23, 2009 at 1:16 am

    oh my gosh. thank you for this! I was like, “wth, I can’t preview my themes but I can preview the default and classic.” My themes were all in hyphen hahaha. I’m glad I saw your post. Thank you so much.

  3. Tom Usher on May 13, 2009 at 3:22 am

    Oh, this was so helpful of you to post. I love it when people “bother” (no bother at all for some of us — I suspect you’re included in that sentiment) to let others know. It’s such a good thing to put oneself in the shoes of others being frustrated by technology or anything else for that matter. Bless you for it.

    I had to take it a step further and not even use underscores.

    Also, it’s a good idea to do a global search for your old folder or subdirectory name in all of your template files if you’re not starting from scratch but rather doing an overhaul on an existing theme. I had an additional style-sheet-call hiding in my “single” file.

    I’m trying to convert from table layout to div and css to speed up loading, so I have a mess. It’s such a relief to be able to preview.

  4. Kelvin on May 16, 2009 at 9:52 pm

    Thank you! I was ready to pitch the whole thing and start over. Thanks for blazing that trail.