tags:

views:

58

answers:

3

Hey how do I showcase my themes like WooThemes has done. I don't want to use multiple databases and Wordpress installations? Can you suggest me any reliable solution which lets me use the same database for all themes.

Thanks

A: 

If all the themes use the same CSS setup (what I mean by that is all the id's and classes that you use for styling are the same in all the themes) then you could simple have a drop down menu with this

JavaScript function:

function themeChange(selection)
{
    window.location = "viewtemplate.php?theme=" + selection;
}

And with this HTML:

<select onchange="themeChange(this.options[this.selectedIndex].value)">
    <option value="0" selected="selected">Select Theme</option>
    <option value="1">Theme 1</option>
    <option value="2">Theme 2</option>
</select>

Once the page loads you can use PHP to retrieve the theme selection value and then inject the correct CSS style sheet for that theme.

PHP:

<?php
$theme = $_GET['theme'];

if ($theme == 1)
{
   ?>
   <link rel="stylesheet" type="text/css" href="theme1.css">
   <?php
}
else if ($theme == 2)
{
   ?>
   <link rel="stylesheet" type="text/css" href="theme2.css">
   <?php
}
?>

Hope that helps :)

Thanks

mlevit
A: 

try the Theme Switcher plugin.

windyjonas
A: 

Nice tips thanks for sharing You were prescient with adding video to WP back in 06-07. I’ve come late to the party but things are still evolving and many people are still waiting to jump in. Plus there are so many more hosting platforms to use now.