Have you ever wondered if your visitors are fed up with your WordPress theme? The same theme over and over again? I know I am.
How about giving your visitors the option to change your theme? Do you want to know how to allow your users to view different themes on your WordPress Website?
In this tutorial I will show you how to create a multiple Theme Switcher for your users and also how to create a Theme Viewer to showcase your unpublished themes to your customers.
Theme Switching is the process of providing the ability for the user to change the presentation styles or “look” of your Website with the use of a Theme Switcher. Theme Switchers are plugins which allow the user to control the look of your Website. WordPress Codex…
Using Theme switching to enhance your Website showcase your talents as a Web developer and also provides entertainment for your visitors. The images below are 3 different themes that visitors of this blog can choose from. My first and oldest theme being the Paper Wall.
Installing Theme Switcher Plugin
Is there a plugin that switches between multiple themes installed? Yes, there is. It is called Theme Switcher. Go ahead install and activate the WordPress Theme Switcher plugin. Note that this plugin does work with the latest version of WordPress (Version 3.2.1).
Things You Should Know
After you installed and activated the Theme Switcher plugin, here are few things to consider:
- Make sure that each theme you use has been thoroughly tested, code scrutinized, validated for errors, and customized for rendering and for functionality. Also Make sure that each theme you choose works well with the content of your Website. For instance, I spent about 33 hours over a period of 7 days to add the 2 additional themes to this blog. All the 3 available themes have been extensively modified: design, layout, coding and functionality by me. They are my testing and teaching ground for WordPress/PHP and CSS. My original and oldest theme is the Paper Wall. All 3 themes are considered a work in Progress for improvements, new features and custom coding.
- The themes in your /wp-content/themes/ folder will dictate the number of themes available for your users to switch between. The same themes can also be found in your WordPress Admin Panel in Appearance -> Themes.
- The Theme Switcher plugin does not work with a caching plugin. For instance, if you have W3 Total Cache installed. If you want your users to be able to switch between themes, you need to deactivate the caching plugin, or at least you need to leave the “Enable Page Cache” option unchecked. If you noticed CSS styling issues when you switch between themes, then you need to disable other options in the W3 Total cache, like browser cache, and probably other options. If your WordPress Website is lightweight and your images are compressed and optimized for the Web, then by disabling the caching plugin, you might not notice a significant increase in page load time. You could also flush the buffer as I discussed in Tip8 in my previous tutorial (as well you could implement other significant tips): 14 Tips for Maximum WordPress Performance & Speed.
- The theme Switcher sets a persistent cookie in your browser. Therefore, you MUST allow cookies for the Theme Switcher to work. If you block cookies or delete them on exit, the theme switcher will always start from your “Current Theme” set in your Admin Panel.
- The Theme Switcher plugin will not modify your “Current Theme” that you specified in your Admin Panel. If you use another browser, your Website will be loaded with your “Current Theme” until a cookie is set. The next time around, if you close your browser, and depending on your preferences loading the Website again might start from your preferred theme.
- The persistent cookie is specifically set in every browser. For the first time, if you download your Website in a different browser, your “Current Theme” that you chose in your Admin Panel will render.
- Any caching plugin you use for your WordPress Website, will cache just about anything you set it to.
- Unless told otherwise, the cached pages will be shown to all media (desktop or mobile browsers).
For WordPress Developers: How To Create a Theme Viewer?
Now I will show you how to build a WordPress theme viewer using the Theme Switcher plugin. Let´s say you have an unfinished/unpublished WordPress theme installed in your dashboard and you want to show a demonstration just for your customer, with a direct Web address link and without actually activating it.
If you are a WordPress developer, the nice thing about the Theme Switcher plugin is that you can install and activate it in your dashboard, but NOT add the widget for it in the Widgets Sidebar. In this case, you can type the Web address of the unpublished theme in the browser´s address bar (you need to know the name of the theme – case sensitive – more on that later.) and then you will be able to show your customer´s the custom theme. Let me elaborate.
For this blog, to directly switch themes, without the need of the sidebar´s Widget, you can enter the following URLs in your browser´s address bar:
Note that I created this WordPress blog in a subdirectory (called blog). Your Web address will vary depending if you created your wordPress Website in the root directory or in a subdomain.
Let´s say I created a custom theme for my customer called: Auto Rental. Then the direct URL of the theme would be:
Of course, as a first step, the Theme Switcher plugin must have been installed and activated. In your case, if you can´t figure out the Web address, you could always check the HTML source code for your blog.
How to find out the theme´s name?
You could either go to your WordPress Admin Panel and go to Appearance -> Themes. There you can see the detail of the themes installed. Or in each theme folder (/wp-content/themes/), open the style.css file where the theme´s name is at the top.
What if You don´t want to Show your Visitors All your Installed Themes
Let´s say you have 4 themes in your Admin Panel but you only want to show 3 of them. In this case, go to your /wp-content/themes/ folder, and located the style.css file of the theme that you don´t want to show and add the line:
Status: NotPublic right after the Author: line.
If you want to allow the Theme Switcher plugin to see that theme again, then either delete that line or change it to
What About Google AdSense and Google Analytics code?
If you embedded your Google AdSense and Google Analytics code directly in your WordPress theme files, then make sure that the same code is present in the other themes as well.