Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $pageNumber = (get_query_var('paged')) ? get_query_var('paged') : 1;
- $maxposts = 3;
- global $args;
- $args = array(
- 'posts_per_page' => $maxposts,
- 'post_type' => 'news-item',
- 'paged' => $paged
- );
- $temp = $wp_query;
- $wp_query= null;
- $wp_query = new WP_Query($args);
- $style_classes = array('first','second');
- $style_index = 0;
- ?>
- <?php if (have_posts()) : ?>
- <?php $post = $posts[0]; $c=0; ?>
- <?php while ($wp_query->have_posts()) : $wp_query->the_post();?>
- <?php $c++;
- if( !$paged && $c == 1) : ?>
- <div class="most-recent-post">
- // Large post
- </div>
- <?php else :
- if($paged) :
- //$args -> set( 'posts_per_page', 4 );
- set_query_var( 'posts_per_page', 4 );
- endif; ?>
- <div class="post-block <?php $k = $style_index%2; echo "$style_classes[$k]"; $style_index++; ?>">
- // Normal posts
- </div>
- <?php endif;?>
- <?php endwhile; ?>
- <?php endif; ?>
- <!-- page navigation -->
- <div class="page-navi">
- <?php if(function_exists('wp_paginate')) { wp_paginate(); } ?>
- </div>
- <?php $wp_query = null; $wp_query = $temp;?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement