WordPress tutorial, for developer, Many people wondering How to add custom post type to wordpress menu. Best idea is first create page with custom post type.
For example you created custom post type art then you need to create page name with art. Then create template with name of art.
How to add custom post type to wordpress menu
Add following code in that file.
<?php /* Template Name: Art */ $loop = new WP_Query( array( 'post_type' => 'art', 'posts_per_page' => 10 ) ); while ( $loop->have_posts() ) : $loop->the_post(); the_title(); the_content(); global $post; $custom = get_post_custom($post->ID); echo '<div>'; the_content(); echo '</div>'; endwhile; ?>
Than open your appearance-Menu and add the Art page in navigation or main menu.
Using this trick you can easily add the custom post type in wordpress navigation.
You saved my time. I was looking for this.