WordPress Menu Posts

Making a Menu containing a bunch of Posts is a good way to create a Page with custom ordering/selection. The new WordPress Menus make it really easy to drag and drop and they give you the option to add Posts in the Screen Options tab.

If you want to swap out Menus in your Theme’s Menu Location frequently, it could get PITA to update your Theme every time you make a new Menu. Here’s how to get those Posts to display on your site with only knowing your Theme’s Menu Location slug instead of hard coding the Menu’s slug into your Theme:

// ---	Get the menu locations. Returns array of ( slugs => ids )
//		The menu location slugs are set in the theme's functions.php file. 
//		@see http://codex.wordpress.org/Function_Reference/register_nav_menus
$menuloc 	= get_nav_menu_locations();
$menuid 	= $menuloc[ 'my-themes-menu-location-slug' ];

// ---	Get the currently assigned containing menu and associated posts.
$menuposts 	= wp_get_nav_menu_items( $menuid );