Dougal Campbell's geek ramblings WordPress, web development, and world domination.

March 9, 2005

Theme Preview Plugin

Filed under: Blogs,WordPress,Plugins,Design — Tags: , , , , , , — Dougal Campbell @ 12:14 pm

Early in the development of the “themes” support in WordPress, I bugged Ryan Boren for a “preview” feature. Instead, he wrote a Theme Switcher Plugin, which wasn’t what I wanted (but was still a cool thing to have). Now, he’s finally written a Theme Preview Plugin.

The thing is, I had already given up on him and written my own, weeks ago. I just never got around to documenting it and writing it up.


  • Ryan’s has user-level checks (only level 8 or higher can preview), mine doesn’t
  • Mine does error checking to ensure that the theme actually exists
  • Mine allows you to separately specify which theme to pull the CSS from. This is because the themes themselves allow you to specify the style separately from the templates. This is actually somewhat redundant, but I tossed it in for experimentation, in case I wanted to override the stylesheet.

There, now you have a choice. And choice is always good. Ryan, feel free to add my plugin’s biological distinctiveness to your own 😉

Update 2007-07-26: Since the question keeps coming up — this plugin is compatible with any version of WordPress higher than or equal to version 1.5. This includes versions 2.0, 2.1, and 2.2, and it should continue to be compatible with future versions. It’s only about a dozen lines of actual code, it uses standard WordPress API calls (one function and two filters), and it doesn’t interact with the database. It’s vegan-safe, has a low carbon footprint, and uses recycled bits for maximum ecological friendliness. See the comments for examples of using the plugin here on this site.


  1. WordPress Theme preview plugin . WordPress Preview theme plugin. Hmm. Active, aren’t they?

    Pingback by phil ringnalda dot com — March 12, 2005 @ 6:47 am

  2. Wow, what a perfect candidate for collaboration on the WP-Plugins site! Come on guys. :-p

    Comment by Matt — March 9, 2005 @ 2:29 pm

  3. […] ed by the variety of WP plugins. there’s just a ton of useful stuff out there. Theme Preview Plugin (might be useful in this environment once there are […]

    Pingback by WordPress at Pierce College » Blog Archive » a few more plugins — March 9, 2005 @ 2:57 pm

  4. How can I activate this plug-in in my instalation of WordPress??

    Comment by RUDE — March 10, 2005 @ 4:35 am

  5. You should show an example of your plugin on your page so we can see preview in action.

    Comment by Steve — March 15, 2005 @ 9:42 pm

  6. Simple enough.

    View this post with the Default theme.

    View this post with the Classic theme.

    View my main page with using my wife‘s Digital Divas theme.

    View this post with the Classic theme, but with my rockem-sockem CSS. Note that the sidebar changes, because the full rockem-sockem templates have a customized sidebar with extra goodies not present in the classic theme.

    Comment by Dougal — March 16, 2005 @ 2:35 pm

  7. […] Das erste heißt Theme Preview PlugIn und kommt von Dougal Campbell. […]

    Pingback by im web gefunden » Wordpress - Hilfe bei der Arbeiten an Themen — January 15, 2006 @ 3:24 pm

  8. Cannot modify header information – headers already sent by (output started at… ?!!

    Comment by essus — January 4, 2007 @ 4:24 pm

  9. but after all it’S ok

    Comment by essus — January 4, 2007 @ 4:32 pm

  10. WordPress 2.1 compatible.

    Comment by Dougal — February 5, 2007 @ 12:33 pm

  11. […] Today, i noticed that there was a small problem with the theme demo links. It was working only for users who have registered at the demo site. So, i removed that plugin and installed this one. […]

    Pingback by GotChance - A Geek’s Blog » Blog Archive » Theme Demos Update — May 31, 2007 @ 9:31 am

  12. Hello

    I thinks it’s no compatible with WordPress 2.2 , isn’t it ??

    in the future ?

    thanks for the works

    Comment by Kakushin — July 10, 2007 @ 4:30 am

  13. Yes, it’s compatible with WordPress 2.2, as well. It should continue to be compatible unless some major change is made to the underlying theme API. Try the links in my earlier comment, above.

    Comment by Dougal — July 10, 2007 @ 10:06 am

  14. hum ok but when i upload the plugin on my website, wordpress don’t detect the plugin.

    and if i try to install the plugin with the installer plugin of wordpress, installer say’s : Invalide plugin package

    Do you kow the solution ??

    Comment by Kakushin — July 11, 2007 @ 2:23 am

  15. Is it WordPress 2.2 compatible? I don’t want to lost mysql data.

    Comment by Tomasz Gorski — July 25, 2007 @ 11:23 am

  16. wow I’m impress. There is a lot of changes between classic/default them than your wife theme. I’ve a question about wordpress because I want to start with new release and I want to make some changes in the code and designe.. what about servers without modrewrite module ? Is there a simple method to turn it off like variable in cfg file ? I know that is off topic but I’ll be glad if someone can answer me.

    Comment by Motoryzacja — July 27, 2007 @ 6:43 pm

  17. @Tomasz Gorski
    I was check on my blog and it’s compatible with WordPress 2.2
    And i must say it’s very usefull plugins :)

    thx a lot Dougal

    Comment by Jacek — September 11, 2007 @ 6:02 am

  18. […] Theme Preview Plugin Har du gjort ett nytt WordPress tema som du vill testa innan du visar det för dina besökare? Om sÃ¥ fallet är, dÃ¥ är detta pluginet för dig. […]

    Pingback by WordPress Plugin - Massor av bra WordPress plugins — November 5, 2007 @ 7:55 pm

  19. Excellent work Dougal, i allways enjoy your great stuff and love to read your blog. thank you so much for all your afford.

    Comment by Michael Biner — November 7, 2007 @ 11:34 am

  20. Doesn’t appear to be working in 2.3…

    Comment by James — November 9, 2007 @ 10:44 am

  21. Doesn’t appear to be working in 2.3…

    It’s working here, on 2.3.1 (and it worked in the original 2.3 before the update, too)… Try clicking the links in my comment above. I’ll grant you, this isn’t the most user-friendly plugin, since you have to manually tack on your own querystring. Try previewing the ‘classic’ or ‘default’ themes on your site, does that work?


    I promise that *one day* I’ll release a new version of the plugin. Planned features for the future version:

    • Admin screen to set options
    • Option for setting a session cookie so that the preview is persistent
    • List the installed themes and let you choose which one to preview

    Comment by Dougal — November 9, 2007 @ 11:14 am

  22. […] Theme Preview – Allows you to see what a different theme will look like on your site, without having to actually activate it. Here are a couple of examples for my site: […]

    Pingback by A couple of fun and useful plugins | The Sucessful Part-Time Networker — November 18, 2007 @ 1:13 am

  23. It will be great, when you can add a Link in Admin-Screen > Themes to Preview the Theme directly

    Comment by Ambit — November 18, 2007 @ 1:43 pm

  24. great news. But I have problem with this plugin :(

    Comment by hosting — November 22, 2007 @ 5:49 am

  25. “I promise that *one day* I’ll release a new version of the plugin.” i hope the day will come in nearest future, it sounds interesting with the new planned features. please keep us up2date.

    Comment by Maya — November 24, 2007 @ 3:27 am

  26. Thank you so much for this very useful plugin… just used it to provide a live preview for a theme I just released. Saved me from the hassle of creating a separate install for previews. Thanks again :)

    Comment by Hafiz — December 17, 2007 @ 11:40 am

  27. I just applied Theme Preview to an old blog of mine which is running on WP 1.5 – i’m to lazy to update WP version. I confirm – everything works fine. Excellent work, Dougal!

    Comment by Yury, logo designer — January 6, 2008 @ 4:12 pm

  28. […] to Dougal Campbell for the original Preview Theme plugin. Posted by Alexandre Girard Filed in plugin, preview, theme, […]

    Pingback by YAB » Blog Archive » [Wordpress] Theme viewer plugin — January 18, 2008 @ 3:06 pm

  29. Hi Douglas,

    Thanks for your plugin, i’ve made some modification to it, you can check the top-left corner on

    If you want to download it, or more information, go to check



    Comment by Alexandre Girard — January 18, 2008 @ 3:08 pm

  30. […] Plugin Homepage […]

    Pingback by Theme Preview_Wordpress plugin — January 22, 2008 @ 9:26 am

  31. […] A little showcase of my work, nothing much. Actually a test of my new plugin = theme viewer by Dougal. […]

    Pingback by Blog » Blog Archive » Showcase WP Themes — February 1, 2008 @ 6:35 am

  32. […] (HeadMeta, Text Filter Suite, and Easy Gravatars), work just fine. The one that doesn’t work is Theme Preview. When I can find time, I’ll try to figure out […]

    Pingback by geek ramblings » WordPress 2.5 Beta — March 2, 2008 @ 9:51 pm

  33. […] Preview Theme:  Allows themes to be previewed without activation By Dougal Campbell. […]

    Pingback by wordpress plugins | what i use | phoFuki — March 4, 2008 @ 8:28 pm

  34. It’s not working with me. I don’t know what is missing. Procedures I did.

    – Uploaded the plugin on my plugin folder
    – Activated the plugin on admin
    – Test the URL with special parameters
    – Failed!

    Query sample:


    Can anyone please help me on this plugin. Thanks.

    Comment by UNO — March 20, 2008 @ 4:56 pm

  35. Thank you for your amazing site.

    Comment by Gry dla Dzieci — April 8, 2008 @ 12:30 pm

  36. Searching through websites I came across this article. I think it is fairly interesting considering the spam crusing about the net. Good Job.

    Comment by prezent — April 25, 2008 @ 11:38 am

  37. I’m now start my wordpress blog, i did really want to get more information about the theme

    Comment by Calvin — April 30, 2008 @ 12:16 am

  38. Hi dougal,

    Your plugin is just what I needed, and it works fine with wordpress 2.5.1. :)

    One problem though, that your plugin is conflicting with “Permalink Validator” (to redirect non-existing page to 301/404 page) and will not work once I turn it on.

    Any suggestions?

    Comment by Rufas — May 13, 2008 @ 5:08 pm

  39. It does’nt work :(

    Comment by shorty — July 31, 2008 @ 9:27 am

  40. shorty on my site all work’s ok

    Comment by Uroda — July 31, 2008 @ 9:31 am

  41. Do you offer the services of setting up Word Press for other companies, your knowledge is vast and you know all the tips and tricks. Im a novice and your blog is awesome, would like some lessons or help setting up one your way. Was going to go to UBD but you seem to be jacked.

    Comment by Goran Web — September 4, 2008 @ 11:25 am

  42. Why does the link to this widget just show code and the widget is misnamed? And why do all the links on this page lead to page errors?

    Lastly, why don’t we get an answer to the questions we ask about how to install this kind of widget?

    Comment by Charlie — October 16, 2008 @ 12:49 pm

  43. I have problem. It does'nt work

    Comment by bizuteria — December 29, 2008 @ 8:47 am

  44. […] Preview Theme: If you’re ever wanting to edit one theme while having another viewable to the public, this is perfect. Not a huge innovation, as there are other ways to do this, but for idjuts like me it’s just dead simplestest! […]

    Pingback by Ensight – Jeremy Wright » 11 Hawt WordPress Plugins I’ve Fallen In Love With — August 21, 2009 @ 10:16 am

  45. I’m not having any luck with this plugin on WP 2.9. Am I not following some hidden instructions or does it just not work with this version?

    Thanks for any tips :)

    Comment by Anna — December 23, 2009 @ 1:06 pm

  46. […] ce va micsora stresul “perfectiunii” in cazul developerilor web, este pluginul Preview Theme.Acesta ne va permite sa vizualizam preview-ul unei teme fara a fi necesara activarea ei, ci doar […]

    Pingback by 20 de pluginuri Wordpress recomandate - prima parte | WorldIT — January 5, 2010 @ 7:22 am

  47. […] Theme Preview This plugin allows you to preview a theme without activating it. All you have to do is add ?preview_theme= onto the end of your URL. This is great for when you are working on a new theme and even for linking your visitors to a preview of a theme that you wish to offer on your site. […]

    Pingback by Karrai — January 9, 2010 @ 8:11 pm

  48. I activated the plugin with no problem. I followed the instructions and even mirrored the examples, but I still cannot get it to show a ‘preview’. It just directs the visitors to the main page. Is the format not ?

    Comment by Alex — January 11, 2010 @ 11:55 am

  49. I activated the plugin with no problem. I followed the instructions and even mirrored the examples, but I still cannot get it to show a ‘preview’. It just directs the visitors to the main page. Is the format not ?

    Comment by e?itim seti — February 18, 2010 @ 10:34 am

  50. Is there a new version or an update of this plugin? It would be nice if there is gonna be a strong and working theme preview plugin

    Comment by Wordpress Theme NL — September 7, 2010 @ 3:46 pm

  51. […] Preview Theme: If you’re ever wanting to edit one theme while having another viewable to the public, this is perfect. Not a huge innovation, as there are other ways to do this, but for idjuts like me it’s just dead simplestest! […]

    Pingback by 11 Hawt WordPress Plugins I've Fallen In Love With — February 3, 2011 @ 10:03 am

  52. […] know some of my favourite plugins but I’d like to suggest a couple to those in my class. Preview Theme by Dougall Campbell is a great one if you’re designing and developing your own themes. You […]

    Pingback by What makes me hit Subscribe | — November 23, 2012 @ 8:00 am

RSS feed for comments on this post. TrackBack URL

Leave a comment

Powered by WordPress

%d bloggers like this: