I Fixed My Broken WordPress Pagination

wordpress pagination

Finally, I fixed my broken WordPress pagination. My theme uses the excellent wp-pagenavi from Lester Chan which has worked very well until recently. Despite my best efforts, I couldn’t find anyone who was sharing the same bug as me.

The problem was that regardless of the paginated URL displayed in the browser, a visitor to SEOgadget would still see the same list of posts. That’s quite a limiting bug – only being able to see my last 10 posts!

Anyway, the problem turned out to be a piece of code I left behind on index.php when I was working out how to exclude specific categories from the home page, to support my WordPress jobs board enhancement. Oops!

Just for interest, the code looked like this:

if (is_home()) {

It’s the highly useful query_posts tag that can be used to determine which posts you’d like to be included (or removed) from The Loop. Once removed, the pagination began to work again.

For anyone looking to exclude posts from a specific category, try Advanced Category Excluder. It even allows control over RSS feeds, which is exceptionally useful if you don’t want to clog your RSS subscribers inboxes with jobs!

Have We Been Helpful?

Builtvisible are a team of specialists who love search, SEO and creating content marketing that communicates ideas and builds brands.

To learn more about how we can help you, take a look at the services we offer.

Stay Updated: Sign Up for New Blog Alerts

Follow: | | |

Tags: , | Categories: Research

2 thoughts on “I Fixed My Broken WordPress Pagination

  1. Sports Blog says:

    This worked perfectly for me. I had been looking for a solution to this problem for days and had no luck. I used the exact same string of code as you and once I removed it, the pagination worked again. Thanks, you’re terrific!

  2. Techpraveen says:

    Great post… Now I fixed the Page navigation problem :)

Leave a Reply

Your email address will not be published. Required fields are marked *