Skip to content
Advertisement

WordPress custom pagination shows same posts on every page

I have been trying to add custom numeric pagination to my custom WordPress theme. Everything seems good so far but the problem is that every page shows the same 3 posts. Is there something I should consider doing while building my own WordPress blog theme. Right now I have my page-archive.php and single.php file there, do I need something else for this to work? Also filtering with category isn’t working, it keeps sending me back to index.php

Code in my index.php file

JavaScript

Code in my functions.php file

JavaScript

1st page

3rd page

I modified my page-archives.php file to this code.

JavaScript

Now my filtering with category is working but if I choose second page from the pagination it doens’t show any posts.

Advertisement

Answer

It turns out I am silly and I don’t need the first half of the code anyways.

JavaScript
User contributions licensed under: CC BY-SA
10 People found this is helpful
Advertisement