I have one problem, I have a one-page wordpress theme and I’d like to implement WP Menus inside it. I created a custom walker so I could create links like #post-slug or #page-slug instead of redirecting the user to another page, but the issue comes when I need to show the posts from the menu on the homepage.
Obviously I can’t show both pages and posts in one query so the only solution would be to create two queries, but still, how can I get the ids of the posts or pages that were added in Appearance > Menus? I need just the pages or the posts and not custom links or categories/etc.
Any help is greatly appreciated.
Try this
Reference: http://codex.wordpress.org/Template_Tags/the_ID
This function displays the ID of the post, to return the ID use
get_the_ID().EDIT
I’m fairly sure you need the
wp_get_nav_menu_items( $menu, $args );function.Reference: http://codex.wordpress.org/Function_Reference/wp_get_nav_menu_items