Theme switch and preview plugin

downloaddonate

With this plugin you can switch to a totally different blog theme when you are logged in to your WordPress dashboard. It’s great for theme development as you can tweak the templates online without breaking stuff for visitors. You can also use it for presentations, to show off various templates. I have added a widget to make this easier.

New in 0.6.0: This plugin has now three basic configurations:

  1. Only admin: This is useful for theme developers and to preview themes on live sites.
  2. Only with passkey: Send your clients preview links. They won’t need an account on your blog for this to work.
  3. Everybody: Theme switching for everybody.

There is a shortcode that has two modes:

Text link cloud demo

Screenshot link cloud demo

Download the plugin from it’s WordPress.org page.

Share this page:
  • Twitter
  • Technorati
  • del.icio.us
  • StumbleUpon
  • Google Bookmarks
  • LinkedIn
  • Reddit
  • Facebook
  • Fark
  • Digg
  • NewsVine
  • MySpace
  • Slashdot
  • Sphinn

90 Comments

  • Posted by WP插件推荐 10/08 | 韶华白首 on 2008/10/09 at 18:26. Reply

    [...] nkthemeswitch [...]

  • Posted by nicolas on 2008/10/12 at 16:45. Reply

    I just found out that a similary plugin already seems to exist, see this page. Well, more choice is a good thing I guess.

  • [...] Theme Switch [...]

  • Posted by John on 2009/01/09 at 11:58. Reply

    I really love this plugin, but it would even be greater if you can set a date that the theme has to change automatically.

    Thanks!

    • Posted by nicolas on 2009/01/09 at 13:17. Reply

      Hm, what would you use that feature for? The plugin is only intended for logged in users, so most of your visitors wouldn’t see the effect anyway.

  • Posted by esieens on 2009/01/11 at 21:38. Reply

    Hi – I would like to use this plugin however even when I activate the widget it does not get displayed in my sidebar (I am logged in as an admin). Other widgets work fine. Any idea what could be wrong?
    Thanks

    • Posted by nicolas on 2009/01/12 at 00:21. Reply

      That’s odd. What wordpress version do you use, do you have some sort of caching enabled? Have a look at the plugin’s settings page as well, maybe “Who should see the theme switch widget” is not set? If not please report back.

      • Posted by esieens on 2009/01/12 at 13:41. Reply

        Ok got it working – deactivated and reactivated everything and it worked! I had obviously done something wrong! Thanks

  • Posted by Romen on 2009/01/31 at 09:27. Reply

    Hey nicolas.. cool plugin – cheers.. maybe you got a little answer for me.. does the plugin change parts in the database?

    • Posted by nicolas on 2009/01/31 at 15:24. Reply

      Hi Romen. No, the plugin doesn’t touch the database at all.

  • Posted by Romen on 2009/02/01 at 10:54. Reply

    Hey.. thanks for the cool plugin its working like clockwork!

  • Posted by Pete on 2009/02/12 at 20:49. Reply

    Hi,

    Great plugin! I want to allow all logged in users the ability to customize the site by CSS style switching. Your widget would work perfectly but unfortunately do to the design of the blog I am not permitting any widgets. What code could I add to my header for example which would allow the same functionality?

    Thanks a million!

  • Posted by nicolas on 2009/02/12 at 22:34. Reply

    Hi Pete, did you read this post? That could be modified to check which $user_ID is the current one I guess.

  • Posted by WordPress 插件推荐(02)_子鸿博客 on 2009/03/01 at 11:04. Reply

    [...] Theme Switch [...]

  • Posted by Paco on 2009/03/14 at 17:11. Reply

    Hi Nicolas,

    i’m using 2.7.1 and when I activate the plugin Worpress doesn’t works. Appears an error that says something like “you do not have permision to enter this page”.

    I hope you know how to solve this.

    Thank you

    • Posted by nicolas on 2009/03/14 at 22:53. Reply

      That’s odd. Can you paste the complete error? If you don’t have enough permissions change them, your FTP client can probably do that.

  • Posted by Roman on 2009/03/16 at 22:18. Reply

    Hello,

    thanks for this plugin. I would welcome if visitors could switch the themes as well. I have a website with free WP templates and also it could deny some themes which I don’t want to show because I am using WP MU platform.

    regards,

    Roman

    • Posted by nicolas on 2009/03/27 at 08:39. Reply

      Roman, that’s a feature I didn’t want to add, but it makes sense for the kind of site you describe. I’ll think about it.

  • Posted by Derek on 2009/03/26 at 12:28. Reply

    nkthemeswitch works great except for one problem: When adding a new page, the template options remain those of the active template, rather than the one I am editing using nkthemeswitch.

    Would be great if this could be fixed. Great plugin.

    Thanks

    • Posted by nicolas on 2009/03/27 at 08:38. Reply

      Hi Derek, it’s true that my plugin doesn’t touch the admin area at all. Do you know of a free template that has options? I’d need one to test if I can implement your idea.

  • Posted by John Morris on 2009/05/05 at 04:11. Reply

    Wondering if your plugin has the ability to use URLs to display a certain theme. I’d like to be able to send my clients to a URL that automatically displays the theme I’ve built for them. Can’t figure out how to do it. I tried something like: http://www.mysite.com/demo/index.php?wptheme=Classic

    But, it doesn’t work. Any help you can provide?

    Thanks!!

    John

    • Posted by nicolas on 2009/05/07 at 16:40. Reply

      Good idea… maybe i can implement it this weeked… no promises though, rather busy lately.

  • Posted by Andy Beard on 2009/05/05 at 19:46. Reply

    It would be useful to be able to have multiple themes for multiple user levels.

    e.g.

    Public
    Subscribers/Members
    Editors
    Admin

    Different widgets is another complication… maybe take a look for wp2.8+ as things are changing?

    • Posted by nicolas on 2009/05/07 at 16:44. Reply

      Hm, the first suggestion sounds relatively easy to do, though I’m not quite sure if I see the need for it. Care to elaborate on a usage case?

      Different widgets is probably not going to happen, that would get rather messy I think.

  • Posted by Tucker on 2009/07/21 at 16:46. Reply

    I wanted to say thanks for the plugin – I actually modified it to perform a browser check instead of a user level check to display a legacy template to IE6 users. Works like a charm!

    • Posted by nicolas on 2009/07/25 at 12:38. Reply

      Tucker, I like this idea. Would you mind sending me a patch? I’m sure it would be useful for other users.

  • Posted by Bronx AnarchY on 2009/08/03 at 22:48. Reply

    Thanks for this plug, But only registered users ? I want anyone select the template in this plugin ?

  • [...] nkthemeswitch [...]

  • Posted by xklaim on 2009/08/13 at 19:51. Reply

    Is there a way to get this plugin to order installed themes alphabetically in the drop-down?

    • Posted by nicolas on 2009/08/14 at 23:56. Reply

      Good idea, the themes are now sorted alphabetically. Thanks for the suggestion.

  • Posted by Vincent on 2009/08/24 at 08:39. Reply

    Attribute minimization is forbidden () it should say () this will help validating your code

    • Posted by nicolas on 2009/08/24 at 10:12. Reply

      Vincent, I can only guess that you mean the widget markup? Yeah, if we assume that everybody uses XHTML the code wouldn’t be correct. I’ll think about it.

  • Posted by Peter K on 2009/10/11 at 01:14. Reply

    Hi Nicolas,

    can this plugin be adapted to display a different theme depending on the page template being used? I want to display a different theme for blogposts and keep the static part of the site under a different theme.

    Thanks for a great plugin!

    • Posted by Nicolas on 2009/10/11 at 12:39. Reply

      Hi Peter, it’s certainly possible to modify the plugin to do that. But the plugin wasn’t really designed to be used for all visitors, I’d have to test lots of things if they break, like caching etc… There’s a comment above by Tucker and he says his modifications work, so there’s some hope.

    • Posted by Nicolas on 2009/10/11 at 12:41. Reply

      Oh, and you should probably look at this page, it sounds like what you want is already possible in WordPress without a plugin.

  • Posted by Peter K on 2009/10/11 at 20:07. Reply

    Hi Nicolas, Thanks for your reply!

    I did see Tucker’s comment above – did he ever send a patch to you? He didn’t supply a website, or a way to contact him. It sounds like his adaptation should work similar to what I’m trying to do.

    What I’m looking to do is a bit different then setting a different template inside the theme directory that looks different form the rest of the site. I want blog posts to display using a theme that resides in a different directory. That would mean being able to check to see if the page is a posts page or not and based on that activate a different theme for that page.

    Your plugin works fantastic for theme development btw, great find!

  • Posted by DavyB on 2009/10/17 at 04:22. Reply

    0.5.0 Does NOT work with child themes, in the theme selection dropdown all the child themes are listed using the name of their parent theme.

    • Posted by Nicolas on 2009/10/17 at 10:23. Reply

      Hello DavyB, I changed the code that returns the theme name. Which parent theme do you use, I’d have to test it. Did this work in earlier releases?

  • Posted by Gerald on 2009/10/25 at 17:02. Reply

    Hi,
    First of all, thank you for this handy plugin.
    As John Morris asked above, having a link to a specific theme would be a fantastic idea. Is-there a way to do that?

    Gérald

    • Posted by Nicolas on 2009/10/25 at 17:18. Reply

      Salut Gerald,
      that feature is already built in. Check the plugin options page to see all available switch/preview links. They are at the bottom of that page.

      • Posted by Gerald on 2009/10/25 at 17:33. Reply

        This is fantastic. Thank you very much. I found it finally – saddly, this function is not clearly indicated on the admin page – as it is an important feature.

        • Posted by Nicolas on 2009/10/25 at 19:40. Reply

          Hm, do you have a suggestion what to change? I thought “Open theme in new window” was obvious.

  • Posted by Leg on 2009/10/28 at 21:19. Reply

    Nicolas, this is really great job.
    How to use the passkey feauture? http://www.domain.com/998464354984655416313ds3f318

    So after the domain goes the passkey?

    • Posted by Nicolas on 2009/10/29 at 10:49. Reply

      Hello Leg,

      Thanks! There are preview links on the options page in the admin area as soon as you enable the preview links. They are at the bottom of the page. I’ll have to think documenting that better I guess.

  • [...] Continued here: Theme switch and preview plugin » Nicolas Kuttler [...]

  • Posted by Gareth on 2009/11/12 at 22:55. Reply

    Hi Nicolas,

    I’m looking for theme switch plugin that doesn’t redirect the user to the index page of the new theme but keeps them where they are.

    Is this an easy modification to your plugin? I’m a gold-certified copy-and-paster but not a php dev!

    Also being able to exclude certain themes would be brilliant – as I think Wordpress’ auto upgrade adds the default and classic themes back into the theme folder if they’re not present.

    Cheers, Gareth.

    • Posted by Nicolas on 2009/11/13 at 03:36. Reply

      Hi Gareth,

      I didn’t realize the new widget does redirect to the home page, I’ll fix that as soon as I can.
      Excluding themes sounds like a good idea, I will add it to the plugin.

      • Posted by Sylvain Carle on 2009/11/14 at 17:42. Reply

        I am interested in excluding some themes too, is this something you are working on?

        • Posted by Nicolas on 2009/11/15 at 15:49. Reply

          I think I will add the option to exclude the default and the classic theme for the next release. I probably won’t add fancy features like a selection which themes to choose from though.

        • Posted by Nicolas on 2009/11/15 at 17:31. Reply

          Actually, the exclude option works now, you can get the development version of the plugin at http://downloads.wordpress.org/plugin/nkthemeswitch.zip

          I will make a formal release as soon as the translations are ready.

  • Posted by Gareth on 2009/11/12 at 23:04. Reply

    Ok – solved this myself by adding the links to new themes manually rather than via the widget (not using the _blank).

    Do these still have the rules set in the options page applied to them eg. cookie setting and expiry?

    • Posted by Nicolas on 2009/11/13 at 03:38. Reply

      Yes, the settings still apply.

      • Posted by Gareth on 2009/11/15 at 23:19. Reply

        Thanks Nicolas – stirling effort!

  • Posted by Nicolas on 2009/11/21 at 19:15. Reply

    Made a new bugfix release, 0.6.1.1. Adding Status: unpublished to the header of a theme’s style.css file will now exclude that theme from being shown in the theme cloud as well.

  • [...] Démonstration de Theme Switch & Preview ! [...]

  • Posted by melanie on 2009/12/02 at 20:58. Reply

    When I click on the click on the screenshot, the Theme does not change. It just links back to my actual site.

    The URL in the address bar displays like http://domain.com/blog&theme=Theme1

    • Posted by Nicolas on 2009/12/02 at 23:11. Reply

      Hm, can you provide a little more info? Are permalinks enabled and on which page did you have the theme cloud? It would be great if I could reproduce the problem.

  • Posted by jacky on 2009/12/04 at 05:16. Reply

    @melanie says :
    i undstand, you can open file : Plugin/inc/themeswitch
    at line :169
    $r .= ‘&’;
    Change it to : $r .= ‘/?’;
    demo : http://www.templatelib.com/demo/?theme=WordPress+Default

    • Posted by Nicolas on 2009/12/04 at 11:57. Reply

      Well, that would break on the next plugin upgrade as this code won’t change for now. I see it could be wrong if a blog has a static frontpage, the cloud is on that static frontpage, and the blog doesn’t use permalinks. It would be great if melanie could comment.

      • Posted by Nicolas on 2009/12/04 at 12:03. Reply

        Replying to myself :-) Yes, this is the scenario where the bug occurs. Will release a fix later today.

  • Posted by Jim on 2009/12/07 at 21:15. Reply

    1. I’m new to wordpress
    2. I have a custom theme that worked before being modifying to wordpress – it now has been modified to wordpress
    3. the dashboard > new themes > upload loads the zip file but there are problems
    3. I downloaded your themeswitch plugin to see if I can identify the error but I don’t know how to use the plugin — could you possibly advise (is it typical to get such problems or is it just me?)
    Thanks

    • Posted by Nicolas on 2009/12/07 at 21:34. Reply

      Sorry, I have no idea what you’re talking about.

  • Posted by Richard Walters on 2009/12/10 at 16:34. Reply

    Nicolas,

    Thanks so much for this plug-in. I LOVE IT!

    I would like to comment on a small thing that I noticed with it. I use it as a WIDGET on the side panel … not with images of screen shots … Just the drop-down selecting tool.

    Here’s the small problem I noticed. If I’m currently viewing the base URL of my website and switch to a different theme, then the plug-in makes the theme switch alright, but it throws me at a particular article only location … it doesn’t make the switch at the base URL that I was at before the switch.

    I also noticed that if I’m viewing a specific category and use the plug-in to switch the theme, then it again will switch themes, but leaves me at a randomly selected article … not viewing the category I was at when I made the switch.

    For me, this is only a small annoyance, and I still LOVE THIS PLUG-IN. I’m also only 3 months into WordPress as well and love it as well. But it would be great if I could have the plug-in make the switch and be viewing exactly the same content afterwards as before!

    I have not tinkered with any of the code for Theme Switch … but have done extensive customization in other places. Let me know if it’s possible that this may be on my side and not occurring with anyone else. I also have Elegant Box as my default theme … which itself has several optional styles that are selectable … could it be possible that this is interfering with the Theme Switch Plug-in not matching the exact URL during it’s use?

    I certainly do not want to you to spend an enormous time on this … it’s not THAT important to me … hopefully this might be a quick fix. :)

    thanks again for the time and energy spent contributing this plug-in to the community,

    best regards,

    • Posted by Nicolas on 2009/12/11 at 15:05. Reply

      Hi Richard, thanks for the report. I’ll look into this ASAP!

    • Posted by Nicolas on 2009/12/21 at 18:02. Reply

      Finally found a few minutes, I’m uploading the fix right now. Thanks for reporting this Richard!

      • Posted by Richard Walters on 2009/12/22 at 17:43. Reply

        Hi Nicolas,

        Thanks so much for your efforts; however, the fix does not seem to be working for my site.

        Is Version 0.6.1.3 the latest version?

        I tried a clean install by deleting the plugin and re-installing using the WordPress automatic install wizard.

        I have settings set for allowing anyone to switch the theme. Still, the main problem is that if you are at the BASE URL of RichImages.net and perform a switch theme request, then you will be thrown to a particular article ( looks to be the oldest article for the current month ).

        Again, if this is an easy fix, greatly appreciated. If not, then it can be placed very low on my priorities.

        best regards,

        Richard

        • Posted by Nicolas on 2009/12/22 at 20:01. Reply

          Oops. It looks like I made the release without including the bugfix, sorry about that. 0.6.1.4 should fix that, uploading right now.

  • Posted by Richard Walters on 2009/12/22 at 21:18. Reply

    Thanks … works great ( hate to run you through version numbers :) )

    Base URL works perfect through a switch, … so does viewing an individual article; Switching will from the base URL or a particular article will maintain consistency after the switch.

    ( Testing Feedback: Viewing or and switching themes throws you at some particular post … but I doubt 95% of viewers will ever notice this, as they probably switch themes some time before selecting a category or monthly archive! )

    Thanks for the updated version!

    • Posted by Nicolas on 2009/12/22 at 22:15. Reply

      Oh right. This is because wp thinks it’s on the page that shows the first article when you’re on any list page. This is quite annoying. It’s fixed now, hopefully for good :-) Thanks for reporting it!

      By the way, both fixes were basically one-liners, so no worries :-D

      • Posted by Richard on 2009/12/22 at 23:11. Reply

        Thanks … works Great!!!!

        This is quite an improvement for those that make this plug-in available to all viewers for their personal preference!

        Glad both were one-line fixes as well!

  • [...] локалізацією та користуйтесь на здоров’я. Домашня сторінка плагіну | Завантажити плагін   Українська локалізація [...]

  • Posted by AzzePis on 2009/12/24 at 11:14. Reply

    Hi, thanks for great plugin. It helps me many times.
    I’ve made Ukrainian translation – http://wordpress.co.ua/download/plugins/theme_switc_uk_translations.zip

    Thanks again!

    • Posted by Nicolas on 2009/12/26 at 09:20. Reply

      Hi AzzePis, this is great, thanks a lot! I will include your translation in the next release.

  • [...] Theme Switch [...]

  • Posted by Kirk M on 2010/01/10 at 01:26. Reply

    Hi Nicolas – Okay, here’s a weird one. I installed your plugin (0.6.1.5) into my personal blog (running 2.9.1) and it activated okay and switched between my installed themes without a problem. However…(isn’t there always a however?)

    When it’s activated and I attempt to add a new theme via “Themes/Add New” and click “Install” on any theme I wish to try, it opens up the install pop-up box for “Nice Wee Theme” only rather than the theme I want to install (yup, “Nice Wee Theme” is listed in the WP themes directory, BTW).

    To clarify, when “Theme Switch and Preview” plugin is activated, no matter what new theme I try to install via 2.9.1’s add new theme function, it always pops up the install dialog box for “Nice Wee Theme” without exception.

    Note: I can’t actually install “Nice Wee Theme” though as hitting the Install button takes me to a “Are you sure you want to do this” page with a “Try again” link that takes me back to the same page.

    Disabling the plugin via it’s options doesn’t solve the problem but deactivating it returns everything to normal and I can add new themes as usual.

    Just to make sure I installed 0.6.1.5 on an online test site also running 2.9.1 and had the same results. All my error logs are clear so no info there.

    Any ideas?

    • Posted by Nicolas on 2010/01/10 at 16:21. Reply

      Hi Kirk, not really, but thanks for the detailed report. I’ll try to reproduce the problem.

  • [...] the help of an excellent plugin for WordPress called Theme switch and preview, this tutorial will allow you to easily switch between the live site and development versions using [...]

  • Posted by Richard Walters on 2010/01/14 at 16:56. Reply

    Hi Nicolas,

    Just upgraded to the latest and am having the following problem:

    I have no widget to drag to the sidebar to allow users to switch themes.

    Thanks,

    • Posted by Nicolas on 2010/01/15 at 01:23. Reply

      Wow, thanks for the report. I wonder how I could miss that… uploading the fix right now.

      • Posted by Richard Walters on 2010/01/15 at 20:42. Reply

        Nicolas,

        Thanks for the speedy fix! Your dedication speaks volumes!

        best regards, sir,

  • Posted by Matthieu Ribolleda on 2010/01/21 at 21:58. Reply

    Hi Nicolas,thanks for your contribution.
    Do you know a french traduction of this plugin ?

    • Posted by Nicolas on 2010/02/07 at 10:41. Reply

      Salut! Sorry, I think I missed your comment earlier. There is a tool called poedit http://www.poedit.net that you can use to translate the plugin. If you send me your translation I’ll include it.

  • Posted by Natalie on 2010/02/06 at 22:47. Reply

    Hi great plugin. Glad to find it!

    Totally newbie question with this, but can something like this plugin be used to develop not only a different theme (ie look and feel) but a completely different site with new content, areas etc?

    In other words, I have a very basic default theme currently live that amounts to a basic information page and that a new site is coming. Using your plugin, can I be developing this new theme with a new look and feel as well as all new pages, areas, page templates. In other words I want to hide the new content as well as the theme. Is that possible with this plugin? Or will I have to make pages/posts active/inactive as I go through development in conjunction with the theme switcher plugin?

    Sorry for such a basic question, but trying something I haven’t done before and hoping this plugin can help. Many thanks for any help!

    • Posted by Nicolas on 2010/02/07 at 10:39. Reply

      Hi. Hmmmmm. There are various ways of doing what you describe. The easiest would be to hide new pages/posts as you say.
      I would probably make a second WordPress install, create the new site there, and then move it to the live site.
      The WordPress 3.0 release will make all of this much easier, as you will be able to have multiple blogs in one install. I think it’s scheduled for release in march.

  • Posted by Jim on 2010/02/08 at 05:46. Reply

    I am trying to add this great plugin to my tabs on my homepage. I have to call it, but I don’t have any clue how.

    [nkthemeswitch] doesn’t work. It has to be php. What code can I use?

    Thanks
    Okoth

    • Posted by Nicolas on 2010/02/08 at 14:26. Reply

      I think calling nkthemeswitch_shortcode() should work.

  • Posted by petskratt on 2010/02/08 at 22:52. Reply

    just to report that problem described by Kirk M reproduces very well on all my 2.9.1 WP and latest plugin installs… theme offered for Install is different, though :-)

    • Posted by Nicolas on 2010/02/09 at 01:55. Reply

      Yeah, didn’t have the time yet to look into it, sorry about that.

Leave a Reply

Your email is never shared. Required fields are marked *

*
*