I want to create a news page displaying only 3 posts per page and if there are 5 posts the last two posts will display on the second page.
Here is what I have got so far...
<?php query_posts('category_name=news&&showposts=3'); ?>
<?php while (have_posts()) : the_post(); ?>
<div class="tpost-whole">
<hr /> <!--creates spaces between each posts-->
<div class="post-thumbnail">
<?php if ( has_post_thumbnail()) : ?>
<a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>" >
<?php the_post_thumbnail('thumbnail');?>
</a>
<?php endif; ?>
</div>
<div class="tpost-title">
<h3><a class="tpost-title" href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>" ><?php the_title(); ?></a></h3>
</div>
<span class="post-date"><?php the_time('F j, Y') ?></span><br />
<?php echo apply_filters('the_excerpt',get_the_excerpt().'<a href="'.get_permalink().'"> read more </a>'); ?>
<hr /> <!--creates spaces between each posts-->
</div>
<?php endwhile; ?>
<!--Pagination-->
<?php echo paginate_links( $args ) ?>
<?php
global $wp_query;
$big = 999999999; // need an unlikely integer
echo paginate_links( array(
'base' => str_replace( $big, '%#%', esc_url( get_pagenum_link( $big ) ) ),
'format' => '?paged=%#%',
'current' => max( 1, get_query_var('paged') ),
'total' => $wp_query->max_num_pages
) );
?>
The problem is when I clicked to the second page it doesn't display the last two posts. It still display the first 3 posts.
Please help me! Thanks