Create a live demo gallery for themes

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.