Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

How can i display 4 diferent themes for an archive page When i click on the right in corner i want to display another theme, another Css style (my own)

Something like this.

http://tvpedia.org/lista-seriale/seriale-noi-2012

Thanks

share|improve this question

1 Answer 1

up vote 0 down vote accepted

It appears that the site you linked to is just using a url parameter to specify which view to serve. A simply way to accomplish this is to create four different loop templates, each employing a different layout. Using the example site, you would need the following:

loop-complex.php, loop-simple.php, loop-poster.php and loop-logo.php

Then your normal templates (index.php, archive.php) would start out as something simple like this:

<?php 
get_header();

$view = 'complex';
get_template_part( 'loop', $view );

get_sidebar();
get_footer(); 
?>

Now all that is needed is to process the url parameter and change which loop template is pulled in based on it's value (and of course making sure it is a valid value):

$view = 'complex';
$mode = stripslashes( $_GET["layout"] );
$modes = array('complex', 'simple', 'poster', 'logo');
if(in_array($mode, $modes)) $view = $mode;
get_template_part('loop', $view);

Then you just code the four different loops to make the different layouts appear how you want them to.

share|improve this answer
    
solved. Thanks Ed Burns!! –  Batman Jan 1 '13 at 21:46

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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