Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

Question: Is there any possibility to get next/previous page id in wp_nav_menu in wordpress.

Example: I have navigation menu like this

Menu_Item_1  (ID = 5)

Menu_Item_2 (ID = 11)

If I am on the Menu_Item_1 or any of its child pages, the id of the next top level menu item ( Menu_Item_2 in this case) must be stored in a variable and so on.

share|improve this question
Not easily. While this is not a duplicate it is a solution to a similar problem and may get you started. –  s_ha_dum Apr 4 '14 at 14:46

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.