views:

34

answers:

1

Hi,

Just playing around with Wordpress 3.0 for the first time. I've installed the Custom Post Type UI plugin, and have created a custom post type: "composers".

How do I go about creating a navigation menu for all the composers? Ideally, I'd like a static page entitled 'composers' which has a nav menu of all the individual composers.

In the Appearance -> Menus page, I can create a menu and assign composers individually to it, but what do I need to do to just add the entire collection of composers to a menu, so that it updates when I add a new composer? Surely I don't have to add them all manually?

A: 

What you're trying to do might be better achieved as a plugin, or a little editing in your theme file, something along the lines of;

$composers = new WP_Query('post_type=composers');
if ($composers->have_posts():
?>
<ul class="composer-nav">
    <?php while ($composers->have_posts()): $composers->the_post(); ?>
        <li>
            <a href="<?php the_permalink(); ?>"><?php the_title(); ?></a>
        </li>
    <?php endwhile; ?>
</ul>
<?php endif; ?>

I know the idea behind custom menus was to try and avoid the need for plugins or theme editing, but I think it was truly designed for users to be able to pick and choose exactly what they wanted, rather than automatically listing items (just my opinion).

TheDeadMedic