While working on a client project I thought it would be best to use real content from the clients site to check, amongst other things, if pagination was working on the home page.

After importing the clients data into my development site I refreshed the the home page and looked for pagination at around 10 posts (the default).

Not so – the home page filled up with posts and right at the bottom was my post navigation – older / newer posts links.

I visited the WordPress Settings, Reading page and changed the “blog pages show at most” settings to a different number and refreshed the page.

Again nothing changed.

This time I search to see if this was a known issue (can’t think why it would), I checked my index.php code and compared to other theme files, I switched to the default WordPress theme and still the homepage filled up with posts.

Finally after more searching I came up with the solution – sticky posts.

It was then that I realized that all the posts in the client data (over 300) were set to sticky.

That’s why the pagination wasn’t working.

Now, in the WordPress Admin Dashboard I’ll have to uncheck “Make this post sticky” for each post or (perhaps a little faster) manually change one option in my wp_options table to changes the sticky settings.

If you are comfortable messing with your WordPress database you can reset the ‘sticky_posts’ option in the wp_options table. I made the following change to the ‘sticky_posts’ field in my development database. I edited it to be “a:0:{}” and all the sticky posts were gone!

A simple solution to cap off some head scratching and I hope this helps you out if you encounter the same issue.

Categories: WordPress

0 Comments

Leave a Reply

Avatar placeholder