Theme switch and preview plugin

Tagged WordPress plugin

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 and Enjoy:
  • Print
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google Bookmarks
  • Blogplay

Related posts:

  1. My plugins featured in Web Designer Magazine
  2. Creating a valid WordPress theme
  3. WordPress Fireworks Plugin

187 Comments

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

    [...] nkthemeswitch [...]

  • Posted by nicolas on 12. October 2008 at 16:45.

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

  • Posted by WordPress Plugin Releases for 11/13 | Weblog Tools Collection on 13. November 2008 at 21:30.

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

  • Posted by John on 9. January 2009 at 11:58.

    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 9. January 2009 at 13:17.

      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 11. January 2009 at 21:38.

    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 12. January 2009 at 00:21.

      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 Romen on 31. January 2009 at 09:27.

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

  • Posted by Romen on 1. February 2009 at 10:54.

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

  • Posted by Pete on 12. February 2009 at 20:49.

    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 12. February 2009 at 22:34.

    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 1. March 2009 at 11:04.

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

  • Posted by Paco on 14. March 2009 at 17:11.

    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 14. March 2009 at 22:53.

      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 16. March 2009 at 22:18.

    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 27. March 2009 at 08:39.

      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 26. March 2009 at 12:28.

    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 27. March 2009 at 08:38.

      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 5. May 2009 at 04:11.

    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 7. May 2009 at 16:40.

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

      • Posted by John on 17. June 2010 at 10:17.

        Hi,
        Love your theme switch and preview plugin.
        Did you ever get the chance to work on the ability to use URLs to switch themes?

        • Posted by nicolas on 17. June 2010 at 10:25.

          That has been working since… forever :-)

          • Posted by John on 17. June 2010 at 10:28.

            Oops, sorry about that.
            What shoud I put in the URL?
            thx.

            • Posted by nicolas on 17. June 2010 at 10:57.

              You can go to the plugin settings page, there are links to all the themes you have installed at the bottom. Basically, url?theme=theme_name.

  • Posted by Andy Beard on 5. May 2009 at 19:46.

    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 7. May 2009 at 16:44.

      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 21. July 2009 at 16:46.

    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 25. July 2009 at 12:38.

      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 3. August 2009 at 22:48.

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

  • Posted by xklaim on 13. August 2009 at 19:51.

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

    • Posted by nicolas on 14. August 2009 at 23:56.

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

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

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

    • Posted by nicolas on 24. August 2009 at 10:12.

      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 11. October 2009 at 01:14.

    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 11. October 2009 at 12:39.

      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 11. October 2009 at 12:41.

      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 11. October 2009 at 20:07.

    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 17. October 2009 at 04:22.

    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 17. October 2009 at 10:23.

      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 25. October 2009 at 17:02.

    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 25. October 2009 at 17:18.

      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 25. October 2009 at 17:33.

        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 25. October 2009 at 19:40.

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

  • Posted by Leg on 28. October 2009 at 21:19.

    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 29. October 2009 at 10:49.

      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 12. November 2009 at 22:55.

    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 13. November 2009 at 03:36.

      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 Gareth on 12. November 2009 at 23:04.

    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 21. November 2009 at 19:15.

    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 2. December 2009 at 20:58.

    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 2. December 2009 at 23:11.

      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 4. December 2009 at 05:16.

    @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 4. December 2009 at 11:57.

      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 4. December 2009 at 12:03.

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

  • Posted by Jim on 7. December 2009 at 21:15.

    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 Richard Walters on 10. December 2009 at 16:34.

    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 11. December 2009 at 15:05.

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

    • Posted by Nicolas on 21. December 2009 at 18:02.

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

      • Posted by Richard Walters on 22. December 2009 at 17:43.

        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 22. December 2009 at 20:01.

          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 22. December 2009 at 21:18.

    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 22. December 2009 at 22:15.

      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 22. December 2009 at 23:11.

        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 24. December 2009 at 11:14.

    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 26. December 2009 at 09:20.

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

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

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

    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 10. January 2010 at 16:21.

      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 14. January 2010 at 16:56.

    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 15. January 2010 at 01:23.

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

  • Posted by Matthieu Ribolleda on 21. January 2010 at 21:58.

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

    • Posted by Nicolas on 7. February 2010 at 10:41.

      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 6. February 2010 at 22:47.

    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 7. February 2010 at 10:39.

      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 8. February 2010 at 05:46.

    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 petskratt on 8. February 2010 at 22:52.

    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 Ron Merk on 17. February 2010 at 20:39.

    Hi Nicolas:

    Ran into a potential small bug … I’m using WP 2.9.2

    When I try and install a new theme using the internal WP auto install, Wordpress always gives me the very 1st theme “vermilion” no matter what I chose.

    As soon as I deactivate “Theme Switch & Preview” everything works fine

    • Posted by Nicolas on 18. February 2010 at 13:48.

      Hmmm, installing new themes doesn’t work for me at all, with or without my plugin. No idea, I’ll need to look into this.

      • Posted by Ron Merk on 18. February 2010 at 19:26.

        I think I had to shut down my browser, clear it’s cache after deactivation your plugin – then new themes download and install worked.

  • Posted by New, extremely minimalist redesign | Nomulous Blog on 19. February 2010 at 06:17.

    [...] I’ve finally implemented the new, extremely minimalist design everywhere. The plugin Theme Switch helped a bunch, because it allowed me to preview what I was working on without the general public [...]

  • Posted by Ian Sherr on 22. February 2010 at 08:37.

    Hello,

    I’m trying to use this plugin with little luck. Every time I go here:

    http://www.iansherr.com/clips/?theme=default

    To preview/switch to WordPress Default 1.6 with little luck.

    My WordPress installation lives in iansherr.com/clips

    Any idea what might be happening? I have SuperCache turned off, and your plugin settings set for everyone.

    Any ideas on what to do?

    Thanks.

  • Posted by Nabeel on 22. February 2010 at 18:42.

    Hi Nicolas,
    I really admire your work but I have a problem with the plugin I am using wp 2.9.2 and the switching works ok while I am logged as admin and just I choose the theme I want from the drop down menu it changes but if I am not logged in when I choose a theme the page refreshes quickly and nothing happens I have to reload the page manual in order to theme changes .
    please Nicolas could you help me fast cause really need it to work.
    thanks for you time

    • Posted by Nicolas on 22. February 2010 at 21:20.

      That’s odd, can you post a link to your site?

      • Posted by Nabeel on 22. February 2010 at 22:25.

        hello,
        this the link : http://imegyptian. com/blog/
        I don’t know what is the problem I reinstalled, deactivate and reactivate it.
        thanks

        • Posted by Nicolas on 22. February 2010 at 23:13.

          Hard to tell without access to the server. Looks odd indeed. You should probably try to reinstall the plugin. IIRC the plugin modifies the http headers to do the redirect itself, maybe your server config doesn’t allow that… I’m kind of clueless here.

  • Posted by FanZy on 23. February 2010 at 08:02.

    Nic, I found something weird.
    I got 2 themes.
    When I set theme A as default, the plugin works well. But if I set theme B as default, no matter admin or user with passkey the page always redirect to theme B, no more theme A

  • Posted by Nabeel on 23. February 2010 at 10:37.

    Thanks Nicolas, but the redirect happens only when I am logged in but if a visitor it does what you sow.

  • Posted by Lizzy on 23. February 2010 at 12:49.

    This is a very good plugin. But there’s one problem: it isn’t compatible with WP’s theme editor, it gives error when I try to save the edited theme files. I have to deactivate the Theme Switch plugin, then the theme editor works, and reactivate the plugin.

    I hope that you can fix this in the next version!

    • Posted by Nicolas on 23. February 2010 at 13:53.

      Hi Lizzy, yes, this is at the top of my todo list. I hope to be able to fix this soon.

  • Posted by Martina on 27. February 2010 at 13:42.

    Hello, can you tell me how to display the mode screenshot in a template? I tried but it doesn’t work. Thank you, Martina.

    • Posted by Nicolas on 27. February 2010 at 15:12.

      Hi Martina, the shortcode to do that is [nkthemeswitch mode=screenshot]

  • Posted by Martina on 27. February 2010 at 15:54.

    Thanks, Nicolas,
    I’d like to show it in the footer.php, not on a page or post, is that possible somehow?
    (wordpress took my code out of the last comment, I used: nkthemeswitch_shortcode( ‘mode=screenshot’ )

    • Posted by Nicolas on 27. February 2010 at 17:04.


      $option = get_option( 'nkthemeswitch' );
      $cloud = nkthemeswitch_cloud( $option, '', false, false, true );

      should do the trick I guess. If not have a look at the nkthemeswitch_shortcode function.

  • Posted by Martina on 27. February 2010 at 18:08.

    Thank you so much, that works like charm!

  • Posted by thomas on 4. March 2010 at 01:55.

    themeswitch makes problems in wp 2.9 :( i can’t edit themes in admin-panel. maybe global var $dir is used?!

    relativ:
    /themes//.php

    absolut:
    /usr/www/users//blog/wp-content/themes//.php

  • [...] Theme switch and preview plugin [...]

  • Posted by ukmaceman on 6. March 2010 at 21:50.

    Have just installed this great plugin on http://www.mywordpress.co.uk .

    When using the widget there is no widget title .No settings in the admin area or in the widget admin.

    Any help would be appreciated

    • Posted by Nicolas on 8. March 2010 at 02:20.

      That’s right, there is no title yet. Will be added in the next release. For now, you could simply put a text widget above the switch widget.

    • Posted by Nicolas on 24. March 2010 at 10:58.

      I’m just uploading a new release that allows to set a widget title. Thanks for the suggestion!

  • Posted by Jim on 7. March 2010 at 04:29.

    With this plugin, can you change around the css styling without visitors seeing the changes?

    • Posted by Nicolas on 8. March 2010 at 02:19.

      Well, you’d need to create a copy of your theme first. So, not out of the box.

  • Posted by Tony Soprano on 11. March 2010 at 23:16.

    Hoping you fix that Edit Themes glitch soon!

    Thanks for a great Wordpress plug-in.

    • Posted by Nicolas on 17. March 2010 at 19:50.

      I’ve just made a release that should fix this issue. I hope it works for everybody.

  • Posted by ukmaceman on 7. April 2010 at 05:15.

    Hi

    Have just upgraded to Version 0.7.3.1 .I see now that the default themes are now excluded.
    Now what I was wondering is would you be able to incorperate a way to select what themes to exclude rather then it being hard coded?
    On my site I have modded your code so I can exclude the BuddyPress theme .
    Hopefully this makes sense.

    • Posted by Nicolas on 7. April 2010 at 10:34.

      Hi, you can try what’s described in the FAQ (see readme.txt). I’m not sure though if setting the theme to unpublished will have other effects as well.

  • Posted by Fabulous Anime on 17. April 2010 at 03:14.

    My theme doesn’t use widget and I was wondering if you can provide me the template code?

  • Posted by fatihturan on 26. April 2010 at 16:43.

    Greetings from Turkey!

    We’ve installed Wordpress into /wordpress/ directory. And your Theme Switch plugin doesn’t working now.

    How i can run Theme Switch plugin on our blog?

    Thanks in advance.

    • Posted by Nicolas on 26. April 2010 at 17:51.

      Hello Fatih, the plugin works flawlessly for me, doesn’t matter where I install wordpress.

      • Posted by fatihturan on 26. April 2010 at 17:54.

        @Nicolas: Did you ever tried Theme Switch plugin on which blog Wordpress installed on different directory?

  • Posted by Ben on 6. May 2010 at 05:45.

    Hi there, I’ve been using this for a while and I’ve developed a bit of a bug and I’m not sure if it’s just my code or something else, but if I go from theme 1 -> theme 2 and then back to theme 1, the page will refresh but the theme won’t have changed. Going theme1 -> theme 2 -> theme 3 -> theme 1 works though. The site in question is http://designtest.techgremlin.com/

    • Posted by Nicolas on 6. May 2010 at 09:28.

      To be honest, I have no idea what could be going on on your site. Does the problem happen in different browsers? Do you have an other theme-related plugins? Or ones that do redirects?

      • Posted by Ben on 6. May 2010 at 10:51.

        I think I fixed it, there was a bug in my server configuration that caused expires to be set to 30 days on everything.

  • Posted by Cameron on 8. May 2010 at 00:41.

    Hi Nicholas, I installed the plugin, enabled theme switching but don’t see any tool or control for switching themes. Where would I find that?

    • Posted by Nicolas on 8. May 2010 at 11:23.

      Hello Cameron, you need to use the widget or the shortcode to display the cloud.

      • Posted by Cameron on 8. May 2010 at 16:56.

        Thanks. That’s working now. But I have one other problem. Even though I am logged in as admin in WP, I can only see the widget when it is set for “everyone” to see. I only want admin to see it while I do some theme customizing. Any idea what might be the problem?

  • Posted by The New Creative-Le Studios Outlook | Creative-Le Designs on 10. May 2010 at 22:32.

    [...] come across a plug-in called Theme Switch and it does just that. It allows you to switch themes in an instant and one of the best part of it [...]

  • Posted by Michelle.K on 11. May 2010 at 00:46.

    Hello Nicolas,

    How would I set a cookie that never expires?

    Thanks in advance

    • Posted by Nicolas on 11. May 2010 at 01:15.

      Hi Michelle, that’s not possible. I don’t know off-hand what the maximum cookie expiration time is, just set it to one year or so.
      60*60*24*365 = 31536000

      I guess that should be enough.

      • Posted by Michelle.K on 13. May 2010 at 19:42.

        Thank you Nicolas, that worked like a charm :-)

        Other than that, is there also a possibility to switch also “just” between style.css’s?

        • Posted by Nicolas on 13. May 2010 at 21:30.

          Hm, I’m not sure. It could probably work with child themes, but I’ve never tried that myself. You can read about how to make a child theme here.

  • Posted by Helen on 11. May 2010 at 10:47.

    Hi, great plug-in! Can not figure out though how to style the cloud created with shortcode. I see that a filetr creates a stylesheet but? In my theme it shows up as very tightly spaced links which is a bit hard to read. What can I use for CSS-styling? Would prefer a list when using for testing – showing others different styling.

    • Posted by Nicolas on 11. May 2010 at 16:26.

      Hi Helen, you should install firebug for firefox. Then, right-click on the element you want to style and at the bottom right you can see where the styles are defined.
      I’d guess your theme is responsable for styling them.

      • Posted by Helen on 12. May 2010 at 12:24.

        Thanks Nicolas! I had searched poorly for the classname.
        Found .nkthemeswitch-cloud-text and styled it in the theme style.css with no problem. Only, to make a list of the links instead of cloud have to do some kind of sorting/array not in the css. But after styling I thimk it´s good enough anyway. Makes my life easier showing different styles to co-workers/clients.

        • Posted by Nicolas on 12. May 2010 at 12:27.

          Hi Helen. Hmm, I’m not sure what you mean, what kind of sorting do you need?

          • Posted by Helen on 12. May 2010 at 12:45.

            I would like to display the different theme-links as an ul list instead of a “cloud” for greater clarity. Have put Themeswitch in its own page while testing/showing/developing and some of my visitors seems to be the very stressed-likes-powerpoint-types ;D
            But I think even those should be able to see the different links now with colored backgrounds and lots of spacing (margin/padding).
            To make a list instead I would have to getin to the code instead I guess? Or any options for that?

            • Posted by Nicolas on 12. May 2010 at 13:11.

              Oh, you’re totally right. I just had a look at the code and the plugin doesn’t produce a list, which it obviously should :-?

              I will update that code asap and make the list markup an option. I will probably make it the default choice in a future release.

              • Posted by Helen on 12. May 2010 at 13:26.

                That would be perfect! It would make Themeswitch complete, for my purposes anyway. There is the widget with dropdown but it doesnt seem to work for all users and havent had time to figure out why. Sometimes I dont want it in all sidebars either but maybe on a protected page that I can remove easily and also have comments on for direct feedback.

            • Posted by Nicolas on 12. May 2010 at 13:13.

              Btw, as a quick fix you could probably do something like blah { display: list-item; }.

              • Posted by Helen on 12. May 2010 at 13:23.

                But of course! Tried it earlier, but in the wrong place so I thought it didnt work. I am too short of time to think these weeks, must stop and breathe slowly… Thanks :)

  • [...] Theme Switch : bijzonder handig als je aan een nieuwe layout aan het sleutelen bent en je de bezoekers nog steeds je huidige wil laten zien [...]

  • Posted by Helen on 19. May 2010 at 06:44.

    Thank you for the upgrade! Now it´s perfect with the choice of cloud or ul. Very easy to use.

  • Posted by Aniruddha on 27. May 2010 at 06:05.

    hii Nicolas
    I installed the plugin and it said plugin activated but i cant see anythin…must hav done sumthin wrong…i m usin wp 2.9…pls reply

    • Posted by Nicolas on 27. May 2010 at 21:16.

      Hi Aniruddha. You have to use the widget or shortcode, or simply switch theme from the plugin’s options page. Settings->Theme Switch I think.

  • Posted by Zwille on 2. June 2010 at 20:23.

    Hello Nicolas,

    installed the plugin running WP 2.9.2 – all is working fine. Maybe for further versions, there could be a normal formating the widget as elements. I’m using this plugin for switching just two styles, and so the tags are not ideal to be styled with css. So is there yet an option or code-snipet for calling the switch, with links to the themes?

    Thanks for short answer, sincerely Zwille.

    • Posted by Nicolas on 4. June 2010 at 01:06.

      Hi Zwille, I’m not sure I understand what you mean? If you just want the links to switch have a look at the links on the plugin options page.

  • Posted by CHRIS on 11. June 2010 at 06:39.

    Hi nicolas,

    I love and use your plugin, but I have one sugestion.
    Using screenchots with the names of the themes will be great and usefull.

    What do you think about it? Can you add this in nexts upgrades??

    Thank you!

    • Posted by nicolas on 11. June 2010 at 11:03.

      Hi Chris, good idea! I’ll add that feature as soon as possible!

      • Posted by nicolas on 12. June 2010 at 12:04.

        Feature added, the new release will be available in a few minutes. I had to modify the nkthemeswitch_cloud function, so test the new release if you use that function in your theme.
        I added documentation on how to use that function to the readme.txt as well.

  • Posted by Kristof on 15. June 2010 at 20:08.

    Upgraded to v0.8.0 and now new theme doesn’t display – looks like it’s not reading the CSS file.

    • Posted by nicolas on 16. June 2010 at 10:01.

      Please be more specific. Which mode do you use, how do you switch, etc.

  • Posted by arron on 22. June 2010 at 02:39.

    Having a hard time understanding how the passkey preview links work. I have two generated links there already. What steps do I take to provide my client a link to see the unactive site being worked on?

    • Posted by nicolas on 22. June 2010 at 08:38.

      Hi arron, all switch links with passkeys are at the bottom of the plugin’s settings page. you can just copy them from there and send them to your client.

      • Posted by arron on 22. June 2010 at 21:43.

        Got it. Just “Copy Link”. Thank you for the work you’ve put in to this plugin.

  • Posted by kamal on 25. June 2010 at 20:34.

    nice plugin..planning to use on the site
    voteup india.com

  • Posted by OneDropLeft on 28. June 2010 at 22:30.

    Weiterhin super plugin! Nur konnte ich nicht herausfinden was folgende Option bewirkt (nach der ich dachte gesucht zu haben ;o):

    Das Umschalten von themes im Admin-Bereich aktivieren (für theme-spezifische Optionen)?

    viele Grüße und bitte weiterhin WP bereichern…
    ODL

    • Posted by nicolas on 28. June 2010 at 23:15.

      If the theme has an options page you will be able to access it if this option is enabled. Likewise for sidebars.

  • Posted by pescadito on 2. July 2010 at 04:24.

    Hi Nicolas, i tried to use your nice code in a multisite wordpress, but nkthemeswicth insist to show all the themes installed instead of alloweds ones.

    in multisite you can enable a theme globally or locally (is some tricky but it work, see http://wordpress.org/support/topic/417996) so when you use nkthemeswitch it show more themes that appear in one blog menu appeareance/themes (theme.php).

    may be it’s needed to use get_ALLOWED_themes(); instead of get_themes();

    i try to change it but i get a error and i don’t know what’s missing. have you any idea?

    pd:
    here from messi land, we hope a nice and fair play to saturday game.
    (nice, to us)….

    • Posted by nicolas on 2. July 2010 at 08:29.

      Hi pescadito, interesting, I’ll look into this asap. Thanks for the report.

      • Posted by nicolas on 14. July 2010 at 12:49.

        I’m just uploading a new version. Please check the FAQ on how to enable the get_allowed_themes() on a multisite install.

  • Posted by pescadito on 5. July 2010 at 19:52.

    perhaps you could check this:
    http://wordpress.org/support/topic/419554?replies=1

    • Posted by nicolas on 5. July 2010 at 22:09.

      Thanks a lot! I’ve been too busy to fix this yet, but will in a few days.

  • [...] bug. Basically, a CSS file can break core functionality which can lead to bugs in plugins like my theme switching plugin. It’s a rather rare bug but the sloppiness of the coding is on the same [...]

  • Posted by bingjie on 16. July 2010 at 21:11.

    cool plugins,,,

  • Posted by Patung on 17. July 2010 at 21:35.

    I really wish it didn’t pull every theme but just the ones enabled for the blog that the plugin is activated on, I’ve got some themes that I just don’t want people seeing.

    Secondly, I might be missing it, but on the front end is there not an option to go back to the previous (original) theme? That would help if you’re using the plugin to display available themes to potential clients

    • Posted by nicolas on 18. July 2010 at 08:44.

      There are various ways to exclude themes, see the FAQ. I’m not sure what you mean by go back? You can pick the default theme from the widget or the tag cloud. Or set the timeout.

      • Posted by Patung on 18. July 2010 at 13:35.

        Thanks, sorry hadn’t read the FAQ.

        But on the second question, I swear on Twenty Ten after selecting a different theme in the widget drop down there was no way of returning to the original theme or selecting another one except by just waiting for the timeout and refreshing the page.

        • Posted by nicolas on 18. July 2010 at 15:19.

          Hm. I’d guess you checked the "exclude default themes" option? That would hide 2010.

  • Posted by sky on 19. July 2010 at 11:16.

    firstly,this is really a wonderful plugin,but how can we change the place but the widget

  • Posted by Amit on 26. July 2010 at 14:04.

    Hi Nicolas.

    No requests or questions here.
    Just wanted to let you know that your plugin is great!
    I took this day to find me a plugin that showcases the themes on my site. So I reviewed 9 different plugins, and yours is by far better and simpler to use than the others and it simply does the job it’s supposed to do.
    Great job!

Leave a Reply

Your email is never shared. Required fields are marked *

*
*