I want to create a live demo site like http://www.elegantthemes.com/gallery/ that show themes so when I click on the theme screenshot it takes me to the live theme preview.

I tried two plugins themebrowser and wordpress-theme-showcase they are showing the themes in a list and I can click the theme to view, but when I'm trying to go to any page inside the preview theme it takes me to the original theme that already installed, so also I want to be able to browse the demo theme pages and posts like if it is activated.


Edit: From the source code of wordpress-theme-showcase plugin the Theme Preview URI: php?preview_theme=WordPress%20Default and that's ok for he home page of the new theme, but if I want to go to some page it redirects me to the home page of the installed theme. So I tried to add &p=1 (post url) to the end of the Theme Preview URI above and it works. The question now is how I can append this url to all the links in the preview page

  • Please move your solution to an answer. That is fine and even encouraged so it's in line with site's mechanics and question does not haunt site as unanswered. – Rarst Nov 18 '12 at 13:37
  • @Rarst, I tried to post an answer but I have low reputation, so will add answer after the time. – Ahmad Ajmi Nov 18 '12 at 13:40
  • This may also help you or someone. Introducing Item Switcher. – Shoebox Nov 18 '12 at 20:52


I used the wordpress-theme-showcaseplugin to show a list of themes in the home page, and to can easily browse the theme that is currently preview I changed the way wordpress handle the permalinks. In the wp-includes/link-template.php file in get_permalink function added this code

    $permalink = home_url('?preview_theme='.$_GET['preview_theme'] .'&p=' . $post->ID);
    $permalink = home_url('?p=' . $post->ID);

and in _get_page_link function added this code

    $link = home_url("?preview_theme=".$_GET['preview_theme'] ."&page_id=$id");
    $link = home_url("?page_id=$id");

Hope this will be useful for any one will get this problem.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.