Theme switch and preview 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:
- Only admin: This is useful for theme developers and to preview themes on live sites.
- Only with passkey: Send your clients preview links. They won’t need an account on your blog for this to work.
- 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.



















[...] nkthemeswitch [...]
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 [...]
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!
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.
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
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.
Ok got it working – deactivated and reactivated everything and it worked! I had obviously done something wrong! Thanks
Great!
Hey nicolas.. cool plugin – cheers.. maybe you got a little answer for me.. does the plugin change parts in the database?
Hi Romen. No, the plugin doesn’t touch the database at all.
Hey.. thanks for the cool plugin its working like clockwork!
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!
Hi Pete, did you read this post? That could be modified to check which $user_ID is the current one I guess.
[...] Theme Switch [...]
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
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.
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
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.
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
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.
[...] Theme Switch [...]
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
Good idea… maybe i can implement it this weeked… no promises though, rather busy lately.
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?
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.
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!
Tucker, I like this idea. Would you mind sending me a patch? I’m sure it would be useful for other users.
Thanks for this plug, But only registered users ? I want anyone select the template in this plugin ?
[...] nkthemeswitch [...]
Is there a way to get this plugin to order installed themes alphabetically in the drop-down?
Good idea, the themes are now sorted alphabetically. Thanks for the suggestion.
Attribute minimization is forbidden () it should say () this will help validating your code
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.
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!
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.
Oh, and you should probably look at this page, it sounds like what you want is already possible in WordPress without a plugin.
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!
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.
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?
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
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.
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.
Hm, do you have a suggestion what to change? I thought “Open theme in new window” was obvious.
Nicolas, this is really great job.
How to use the passkey feauture? http://www.domain.com/998464354984655416313ds3f318
So after the domain goes the passkey?
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 [...]
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.
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.
I am interested in excluding some themes too, is this something you are working on?
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.
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.
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?
Yes, the settings still apply.
Thanks Nicolas – stirling effort!
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 ! [...]
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
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.
@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
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.
Replying to myself
Yes, this is the scenario where the bug occurs. Will release a fix later today.
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
Sorry, I have no idea what you’re talking about.
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,
Hi Richard, thanks for the report. I’ll look into this ASAP!
Finally found a few minutes, I’m uploading the fix right now. Thanks for reporting this Richard!
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
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.
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!
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
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!
[...] локалізацією та користуйтесь на здоров’я. Домашня сторінка плагіну | Завантажити плагін Українська локалізація [...]
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!
Hi AzzePis, this is great, thanks a lot! I will include your translation in the next release.
[...] Theme Switch [...]
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?
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 [...]
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,
Wow, thanks for the report. I wonder how I could miss that… uploading the fix right now.
Nicolas,
Thanks for the speedy fix! Your dedication speaks volumes!
best regards, sir,
Hi Nicolas,thanks for your contribution.
Do you know a french traduction of this plugin ?
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.
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!
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.
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
I think calling nkthemeswitch_shortcode() should work.
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
Yeah, didn’t have the time yet to look into it, sorry about that.