WordPress Blog Pagination Not Working WordPress Blog Pagination Not Working wordpress wordpress

WordPress Blog Pagination Not Working


Check your WP loop in the category.php file (aka archive.php). It must contain the following:

if (have_posts()) : while (have_posts()) : the_post();

and finished with:

endwhile; endif;


There is no guarantee that your issue is WordPress related. However, because you haven't given a very general question, I am going to give you a very general answer. This should aid you in figuring out what is wrong and solving it yourself.

  1. Check out underscores. Download it and review the templates (like index.php, archive.php, etc.) to see if you're missing something that underscores includes. The nice thing about underscores is that it's all the basic stuff you need to create a running theme, with no frills. So, if it's there and not in your code, it may be worth exploring. Take special care for any code blocks relating to have_posts.

  2. It may not actually be anything wrong with your theme. Try testing another theme (say, underscores, which you've conveniently downloaded) to see if it has pagination working and intact. If it does, then, you're in luck... That means you just have to dig a bit deeper to reconcile what's wrong with your code that's right with underscores.

  3. If you've discovered that it's not something wrong with your theme but in fact something wrong with your server configuration, that's also something of a relief, in a matter of speaking. It means that you should theoretically be able to test your installation somewhere else, or reinstall your server, and make it work. Before going that far, try to simply reinstall your version of WordPress. Who knows... It could work.


You should pass the "page"/"paged" var in the query_post function:

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('paged' => $paged));if (have_posts()) : while ( have_posts() ) : the_post(); ?><!--Your HTML-->.<?php endwhile; endif;  wp_reset_query(); ?>