Theme Preview Plugin

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.

Differences:

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

Other Posts of Interest

32 Comments

  1. Posted 3/9/2005 at 2:29 pm | Permalink

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

  2. Posted 3/10/2005 at 4:35 am | Permalink

    How can I activate this plug-in in my instalation of Wordpress??

  3. Posted 3/15/2005 at 9:42 pm | Permalink

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

  4. Posted 3/16/2005 at 2:35 pm | Permalink

    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.

  5. essus
    Posted 1/4/2007 at 4:24 pm | Permalink

    Cannot modify header information - headers already sent by (output started at… ?!!

  6. essus
    Posted 1/4/2007 at 4:32 pm | Permalink

    but after all it’S ok

  7. Posted 2/5/2007 at 12:33 pm | Permalink

    WordPress 2.1 compatible.

  8. Posted 7/10/2007 at 4:30 am | Permalink

    Hello

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

    in the future ?

    thanks for the works

  9. Posted 7/10/2007 at 10:06 am | Permalink

    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.

  10. Posted 7/11/2007 at 2:23 am | Permalink

    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 ??

  11. Posted 7/25/2007 at 11:23 am | Permalink

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

  12. Posted 7/27/2007 at 6:43 pm | Permalink

    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.
    thx
    Lukas

  13. Posted 9/11/2007 at 6:02 am | Permalink

    @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

  14. Posted 11/7/2007 at 11:34 am | Permalink

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

  15. Posted 11/9/2007 at 10:44 am | Permalink

    Doesn’t appear to be working in 2.3…

  16. Posted 11/9/2007 at 11:14 am | Permalink

    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?

    e.g.: http://www.example.com/blog/?preview_theme=classic

    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
  17. Ambit
    Posted 11/18/2007 at 1:43 pm | Permalink

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

  18. Posted 11/22/2007 at 5:49 am | Permalink

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

  19. Posted 11/24/2007 at 3:27 am | Permalink

    “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.

  20. Posted 12/17/2007 at 11:40 am | Permalink

    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 :)

  21. Posted 1/6/2008 at 4:12 pm | Permalink

    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!

  22. Posted 1/18/2008 at 3:08 pm | Permalink

    Hi Douglas,

    Thanks for your plugin, i’ve made some modification to it, you can check the top-left corner on http://lasindias.info

    If you want to download it, or more information, go to check http://blog.alexgirard.com/2008/01/18/wordpress-theme-viewer-plugin/

    Cheers,

    Alex

  23. Posted 2/12/2008 at 9:52 am | Permalink

    Адвокат оказывает юридические услуги, юридическая консультация, юридическая
    помощь, юридическая консультация по вопросам таможенного оформления, экспорт,
    импорт, таможенный адвокат, адвокат по контрабанде,
    адвокат по таможенным вопросам, юридическая консультация,
    таможенный адвокат, таможенная консультация, уголовный адвокат, адвокат по должностным преступлениям

  24. UNO
    Posted 3/20/2008 at 4:56 pm | Permalink

    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:

    /index.php?preview_theme=default&preview_css=beach-cars

    Can anyone please help me on this plugin. Thanks.

  25. Posted 4/8/2008 at 12:30 pm | Permalink

    Thank you for your amazing site.

  26. Posted 4/22/2008 at 9:22 pm | Permalink

    ??????????. ???????. ?? 100 ?.?. ?? ??.?.
    ? ?????? ????????? ????????? ?? 150 ?.?. ?? ??.?.
    ?????. ???????. ????????. ???? 15 ???.
    ???????? ?????? ?? ??????.
    8(096)401-35-72 ??????
    8(096)875-88-99 ???????
    zhorik_kab@mail.ru
    http://zhorikkab.ucoz.ru/

  27. Posted 4/25/2008 at 11:38 am | Permalink

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

  28. Posted 4/30/2008 at 12:16 am | Permalink

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

  29. Posted 5/13/2008 at 5:08 pm | Permalink

    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?

  30. Posted 7/31/2008 at 9:27 am | Permalink

    It does’nt work :(

  31. Posted 7/31/2008 at 9:31 am | Permalink

    shorty on my site all work’s ok

  32. Goran Web
    Posted 9/4/2008 at 11:25 am | Permalink

    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.

11 Trackbacks

  1. [...] 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 [...]

  2. By phil ringnalda dot com on 3/12/2005 at 6:47 am

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

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

  4. [...] 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. [...]

  5. [...] 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. [...]

  6. [...] 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: [...]

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

  8. By Theme Preview_Wordpress plugin on 1/22/2008 at 9:26 am

    [...] Plugin Homepage [...]

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

  10. By geek ramblings » WordPress 2.5 Beta on 3/2/2008 at 9:51 pm

    [...] (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 [...]

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

Post a Comment

Your email is never published nor shared. Comments or website URLs deemed to be off-topic or inappropriate may be deleted at the site owner's discretion.