0

I used a loop to display posts from specific categories, then add the code for WP_Paginate plugin under that loop ... below my posts I see pagination links from 1 --> 5 , however when I press page 2 the page shows older posts but when I press page 3 or 4 or 5 it shows nothing at all ! just empty div . I tried another plugins and all show the same pagination numbers and behavior.

here is the code I used

$paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
        $args=array(
        'post_type'=>'post',
        'cat' => 3,4,7,
        'posts_per_page' => 10,
        'paged'=>$paged
        );
        $temp = $wp_query;
        $wp_query= null;
        $wp_query = new WP_Query($args);

        if ( $wp_query->have_posts() ) : while ( $wp_query->have_posts() ) : $wp_query->the_post();
        ?>

         (CONTENT HERE)       

<?php endwhile; endif;  ?>

<?php }   ?>
<?php if(function_exists('wp_paginate')) { wp_paginate(); } ?>
0

When you navigate to page 3-5, does the page shows page not found on the heading of the browser? Is it just a empty div or is it 404 page?

Try to set the number of posts to be shown in reading setting of your admin less than 10 or less then post per page value set in your above code and look if the problem still persists..

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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