I am trying to get the post id by the navigation id to use in a loop. I made a new query to get posts. I am using multiple queries on a page because I need to. one of the queries gets page templates that have categories that you make a post to and it gets displayed by that template. My problem is that if I put in the query to get posts, then I end up with the data in the theme twice. So I want to make it so that only a post that has a navigation link will be displayed. It will still be able to link to the post but I only want the query to get a post that has a nav item. Every time I try, all I end up with is a bunch of this
bool(true)
The functions I have read about, some from this site aren't working the way I understand they should. I have taken code straight out of the codex and it comes up empty http://codex.wordpress.org/Function_Reference/wp_get_nav_menu_items
$menu_name = 'primary';
if ( ( $locations = get_nav_menu_locations() ) && isset( $locations[ $menu_name ] ) ) {
$menu = wp_get_nav_menu_object( $locations[ $menu_name ] );
$menu_items = wp_get_nav_menu_items($menu->term_id);
echo $menu_items->ID;
My attempts have returned nothing.