Forums

How to get the IDs of pages in a custom menu? (2 posts)

  1. Alphard
    Member
    Posted 1 year ago #

    So I have a custom menu and I'm using wp_nav_menu() to get all items. But I also want to get some of the custom fields of each page that is on the menu and that requires the post/page IDs. Any idea how to get them?

  2. idealien
    Member
    Posted 1 year ago #

    Use a custom walker (http://www.kriesi.at/archives/improve-your-wordpress-navigation-menu-output) and then you want the $item->object_id value as the ID of the actual item linked.

    I am still struggling with how to find this for a custom link. Or, how to determine ID by slug or URL when it is a custom post type or similar item.

Topic Closed

This topic has been closed to new replies.

About this Topic