Next and Previous Page links (respecting pge Order attribute)
-
I wish to provide my users with Next and Previous buttons on the pages of my site (small number of pages) that will move them through a sequence set by the page ‘Order’ attribute. This attribute is set in the Quick Edit Admin interface but also with the drag and drop functionality provided by the Simple Page Ordering plugin.
I’m struggling to get links to respect the Order attribute – they seem to use the chronological order.
Found a code snippet on the Codex (https://codex.www.ads-software.com/Next_and_Previous_Links#The_Next_and_Previous_Pages) that works using the Order attribute but I hit an error on the First and Last page in the sequence. “Undefined array key -1” with the ‘Previous’ link on the first page and a similar error on the ‘Next’ link on the last page. The pages in between work fine and the order is as I’ve set within the Admin interface. Are there other alternatives or how do I get round the error?
- The topic ‘Next and Previous Page links (respecting pge Order attribute)’ is closed to new replies.