Passing $_GET variable makes pagination malfunction
-
I have a page on my website that pulls in excerpts of custom posts, 10 per page.
Which posts it pulls in depends on what value is contained within the ‘county’ $_GET variable. For example, this page will pull in posts from the county ‘Cheshire’
/directory/?county=Cheshire
The pagination nav appears correctly as there are more than 10 entries. However if I click ‘next’ I am taken to a new page
directory/page/2/?county=Cheshire
But this page displays the same entries that were on page 1! It does not display any posts after the 10th entry.
Then when I click ‘previous’ I am taken back to the first page (with the same results showing again).
Does anybody know what might be wrong? Is it not recommended passing $_GET variables in WordPress??
- The topic ‘Passing $_GET variable makes pagination malfunction’ is closed to new replies.