Ask your WordPress questions! Pay money and get answers fast! Comodo Trusted Site Seal
Official PayPal Seal

Page layout change WordPress

  • SOLVED

I would like to have this page: http://liv.tv/portfolio_category/trailers/
Have the same layout as: http://liv.tv/613-2/
(It's called the "portfolio 3 columns" layout in the Wordpress panel).
I tried setting the page as the 3 category portfolio (which is what the main-page is set as) but it does not seem to work.

Answers (1)

2012-06-19

Reinaldo Ferro answers:

liv,

you must customize your archive.php template.

copy the content inside of the loop of the page template (Portfolio3Cols) and them past it on archive.php


liv comments:

This is the portfolio3cols.php
What part would be considered the loop?

<?php

/**

* Template Name: Portfolio 3 columns

*/



get_header(); ?>

<div id="fb-root"></div>
<script>(function(d, s, id) {
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) return;
js = d.createElement(s); js.id = id;
js.src = "//connect.facebook.net/en_US/all.js#xfbml=1&appId=168540336539686";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>

<div class="clearfix">

<div class="grid_24">

<div class="holder clearfix">

<div class="fleft">

<div id="categorybox">

<ul class="menu">


<?php if ( ! dynamic_sidebar( 'Before Content Area' ) ) : ?>

<!--Widgetized 'Before Content Area' for the home page-->

<?php endif ?>


</ul>

</div>

</div>

<div class="fright">

<div class="fb-like" data-href="http://facebook.com/liv.tv" data-send="true" data-layout="button_count" data-width="133" data-show-faces="true"></div>

</div>

</div>

</div>

</div>



<div id="content" class="grid_18">



<div id="gallery">

<ul class="portfolio">

<?php

$i=1;

if ( get_query_var('paged') ) {

$paged = get_query_var('paged');

} elseif ( get_query_var('page') ) {

$paged = get_query_var('page');

} else {

$paged = 1;

}

query_posts( array( 'post_type' => 'portfolio', 'posts_per_page' => 12, 'paged' => $paged ) );

if ( have_posts() ) : $count = 0; while ( have_posts() ) : the_post(); $count++;

if(($i%3) == 0){ $addclass = "nomargin"; }

?>

<?php





?>



<li class="<?php echo $addclass; ?>">

<div class="folio-desc">

<h4><a href="<?php the_permalink(); ?>"><?php $title = the_title('','',FALSE); echo substr($title, 0, 40); ?></a></h4>

<time datetime="<?php the_time('Y-m-d\TH:i'); ?>"><?php the_time('m.d.Y'); ?></time>

</div>

<span class="image-border"><a class="image-wrap" href="<?php the_permalink() ?>" title="<?php _e('Permanent Link to', 'theme1418');?> <?php the_title_attribute(); ?>" ><?php the_post_thumbnail( 'portfolio-post-thumbnail' ); ?></a></span>

</li>





<?php $i++; $addclass = ""; endwhile; else: ?>

<div class="no-results">

<p><strong>There has been an error.</strong></p>

<p>We apologize for any inconvenience, please <a href="<?php bloginfo('url'); ?>/" title="<?php bloginfo('description'); ?>">return to the home page</a> or use the search form below.</p>

<?php get_search_form(); ?> <!-- outputs the default Wordpress search form-->

</div><!--noResults-->

<?php endif; ?>

</ul>

<div class="clear"></div>

</div>











<?php if(function_exists('wp_pagenavi')) : ?>

<div class="wrapper"><?php wp_pagenavi(); ?></div>

<?php else : ?>

<?php if ( $wp_query->max_num_pages > 1 ) : ?>

<nav class="oldernewer">

<div class="older">

<?php next_posts_link('&laquo; Older Entries') ?>

</div><!--.older-->

<div class="newer">

<?php previous_posts_link('Newer Entries &raquo;') ?>

</div><!--.newer-->

</nav><!--.oldernewer-->

<?php endif; ?>

<?php endif; ?>

<!-- Page navigation -->





</div><!-- #content -->

<aside class="grid_6">

<?php if ( ! dynamic_sidebar( 'Home Sidebar' ) ) : ?>

<!--Widgetized 'Home Sidebar' for the home page-->

<?php endif ?>

</aside>





<?php get_footer(); ?>


liv comments:

This is the archive, so what should I replace with what? Sorry i am relatively new to wordpress:

<?php get_header(); ?>
<div id="content" class="grid_18 <?php echo of_get_option('blog_sidebar_pos') ?>">
<h1>
<?php if ( is_day() ) : /* if the daily archive is loaded */ ?>
<?php printf( __( 'Daily Archives: <span>%s</span>' ), get_the_date() ); ?>
<?php elseif ( is_month() ) : /* if the montly archive is loaded */ ?>
<?php printf( __( 'Monthly Archives: <span>%s</span>' ), get_the_date('F Y') ); ?>
<?php elseif ( is_year() ) : /* if the yearly archive is loaded */ ?>
<?php printf( __( 'Yearly Archives: <span>%s</span>' ), get_the_date('Y') ); ?>
<?php else : /* if anything else is loaded, ex. if the tags or categories template is missing this page will load */ ?>
Archives
<?php endif; ?>
</h1>

<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
<article id="post-<?php the_ID(); ?>" <?php post_class('box'); ?>>
<header>
<h2><a href="<?php the_permalink() ?>" title="<?php the_title(); ?>" rel="bookmark"><?php the_title(); ?></a></h2>
<?php $post_meta = of_get_option('post_meta'); ?>
<?php if ($post_meta=='true' || $post_meta=='') { ?>
<div class="post-meta clearfix">
<div class="fleft"><time datetime="<?php the_time('Y-m-d\TH:i'); ?>"><?php the_time('l, F j, Y'); ?></time> &nbsp; | &nbsp; <span class="author-post-meta">posted by <?php the_author_posts_link() ?></span></div>
<div class="fright"><?php comments_popup_link('0', '1', '%', 'comments-link', '-'); ?></div>
</div><!--.post-meta-->
<?php } ?>
</header>
<?php if(has_post_thumbnail()) {
echo '<figure class="featured-thumbnail"><span class="img-wrap"><a href="'; the_permalink(); echo '">';
echo the_post_thumbnail();
echo '</a></span></figure>';
}
?>

<div class="post-content">
<?php $post_excerpt = of_get_option('post_excerpt'); ?>
<?php if ($post_excerpt=='true' || $post_excerpt=='') { ?>
<div class="excerpt"><?php $excerpt = get_the_excerpt(); echo my_string_limit_words($excerpt,50);?></div>
<?php } ?>
<a href="<?php the_permalink() ?>" class="button">Read more</a>
</div>
</article>

<?php endwhile; else: ?>
<div class="no-results">
<p><strong>There has been an error.</strong></p>
<p>We apologize for any inconvenience, please <a href="<?php bloginfo('url'); ?>/" title="<?php bloginfo('description'); ?>">return to the home page</a> or use the search form below.</p>
<?php get_search_form(); ?> <!-- outputs the default Wordpress search form-->
</div><!--noResults-->
<?php endif; ?>

<?php if(function_exists('wp_pagenavi')) : ?>
<div class="wrapper"><?php wp_pagenavi(); ?></div>
<?php else : ?>
<?php if ( $wp_query->max_num_pages > 1 ) : ?>
<nav class="oldernewer">
<div class="older">
<?php next_posts_link('&laquo; Older Entries') ?>
</div><!--.older-->
<div class="newer">
<?php previous_posts_link('Newer Entries &raquo;') ?>
</div><!--.newer-->
</nav><!--.oldernewer-->
<?php endif; ?>
<?php endif; ?>
<!-- Page navigation -->

</div><!--#content-->
<?php get_sidebar(); ?>
<?php get_footer(); ?>


Reinaldo Ferro comments:

Not sure if this will work, please send me the URL to download this theme.

This piece of code should work, maybe you have to do some adjustments in the CSS file.


<?php get_header(); ?>
<div id="content" class="grid_18">
<div id="gallery">
<ul class="portfolio">
<?php $i=1;
if ( have_posts() ) : $count = 0; while ( have_posts() ) : the_post(); $count++;
if(($i%3) == 0){ $addclass = "nomargin"; }
?>
<li class="<?php echo $addclass; ?>">
<div class="folio-desc">
<h4><a href="<?php the_permalink(); ?>">
<?php $title = the_title('','',FALSE); echo substr($title, 0, 40); ?>
</a></h4>
<time datetime="<?php the_time('Y-m-d\TH:i'); ?>">
<?php the_time('m.d.Y'); ?>
</time>
</div>
<span class="image-border"><a class="image-wrap" href="<?php the_permalink() ?>" title="<?php _e('Permanent Link to', 'theme1418');?> <?php the_title_attribute(); ?>" >
<?php the_post_thumbnail( 'portfolio-post-thumbnail' ); ?>
</a></span> </li>
<?php $i++; $addclass = ""; endwhile; else: ?>
<div class="no-results">
<p>There has been an error.</p>
<p>We apologize for any inconvenience, please <a href="<?php bloginfo('url'); ?>/" title="<?php bloginfo('description'); ?>">return to the home page</a> or use the search form below.</p>
<?php get_search_form(); ?>
<!-- outputs the default Wordpress search form-->

</div>
<!--noResults-->

<?php endif; ?>
</ul>
<div class="clear"></div>
</div>
<?php if(function_exists('wp_pagenavi')) : ?>
<div class="wrapper">
<?php wp_pagenavi(); ?>
</div>
<?php else : ?>
<?php if ( $wp_query->max_num_pages > 1 ) : ?>
<nav class="oldernewer">
<div class="older">
<?php next_posts_link('&laquo; Older Entries') ?>
</div>
<!--.older-->

<div class="newer">
<?php previous_posts_link('Newer Entries &raquo;') ?>
</div>
<!--.newer-->

</nav>
<!--.oldernewer-->

<?php endif; ?>
<?php endif; ?>

<!-- Page navigation -->

</div>
<!-- #content -->

<aside class="grid_6">
<?php if ( ! dynamic_sidebar( 'Home Sidebar' ) ) : ?>

<!--Widgetized 'Home Sidebar' for the home page-->

<?php endif ?>
</aside>
<?php get_footer(); ?>


liv comments:

I am pretty sure it worked. Fricken awesome! Thanks