0

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.

Thanks

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

3
  • 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. Commented Nov 18, 2012 at 13:37
  • @Rarst, I tried to post an answer but I have low reputation, so will add answer after the time. Commented Nov 18, 2012 at 13:40
  • This may also help you or someone. Introducing Item Switcher. Commented Nov 18, 2012 at 20:52

1 Answer 1

0

Solution

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

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

and in _get_page_link function added this code

if(isset($_GET['preview_theme'])){ $link = home_url("?preview_theme=".$_GET['preview_theme'] ."&page_id=$id"); }else{ $link = home_url("?page_id=$id"); } 

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.