How to paginate a custom query on the single.php file

Say you’re viewing a Custom Post type of “Events” using, “single-events.php” Paginating won’t work because the canonical redirects strip the “/page/2/ for your url. What that basically means is that WordPress tries to find the right post even if the url entered is slightly wrong. So, it strips what you need to paginate. We can override that with a simple function:

One thought on “How to paginate a custom query on the single.php file

Leave a Reply

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

− 1 = 3