• I am using the below code including pagination it works and shows the pagination links but when you click on them each page has same posts as front page why?

    <?php
    $paged = ( get_query_var( 'paged' ) ) ? get_query_var( 'paged' ) : 1;
    $args = array( 'posts_per_page' => 3 ,'paged'=>$paged);
    $the_query = new WP_Query( $args );
    while ($the_query ->have_posts()) : $the_query -> the_post();
     ?>
    <div id="pbox">
    
        <div id="pthumb"><a href="<?php the_permalink(); ?>" class="ptitle"><?php the_post_thumbnail('thumbnail', array('class' => 'mythumbnail')); ?></a></div>
            <div id="pcontent">
        <a href="<?php the_permalink(); ?>" class="ptitle"><?php the_title(); ?></a>
        <?php the_excerpt(); ?><br />
    
    Post Category: <b><?php the_category( ', ' ); ?></b>
    
            </div>
        </div>
    <?php
    endwhile;
    $big = 999999999; // need an unlikely integer
    echo paginate_links( array(
        'base' => str_replace( $big, '%#%', esc_url( get_pagenum_link( $big ) ) ),
        'format' => '/page/%#%',
        'current' => max( 1, get_query_var('paged') ),
        'total' => $the_query->max_num_pages
    ) );
    echo $paged;
    wp_reset_query(); ?>
  • The topic ‘Pagination shows only same posts please help’ is closed to new replies.