I am looking to automatically create a WordPress Menu for the ‘current’ Custom Post Type. I found a useful snippet that outputs the current custom post type here:-
$post_type = get_post_type( $post->ID );
echo $post_type;
But am struggling to translate this (or alternate method) into a dynamically created menu for the current custom post type – list all posts in the custom post type. I can’t do this on an individual custom post type basis as I’m using a master template to display a series of custom post types.
Thanks
Glennyboy
Here’s a super simple way to do it. just create a loop that lists all the page titles wrapped in a link.
This will loop through all the current post’s post type and create an unordered list with all the posts titles, wrapped in links to the posts. You could obviously change the HTML to suit your needs.