I need to set up some pagination using wp_nav_menu, so I need to access the previous, current and next items in a menu. Any ideas?
Leave a Reply
You must be logged in to post a comment.
I need to set up some pagination using wp_nav_menu, so I need to access the previous, current and next items in a menu. Any ideas?
You must be logged in to post a comment.
Ok, here’s what I came up with – and it works.
I adapted the previous answer, to include any post items in a menu (not just pages).
This code returns the previous and next post IDs.