[wp-hackers] display the list of new taxonomy

scribu scribu at gmail.com
Fri Jul 2 18:40:52 UTC 2010


Actually, there's a template tag for that:

the_taxonomies()<http://xref.yoast.com/trunk/nav.html?_functions/the_taxonomies.html>


On Fri, Jul 2, 2010 at 9:13 PM, Mike Schinkel
<mikeschinkel at newclarity.net>wrote:

> Hi Jimmy,
>
> I'm assuming that you know how to create a sidebar widget so I'll skip that
> step.  Here's the basic code you need:
>
>        // $post is assumed to be a post for a Movie
>        $actors = wp_get_object_terms($post->ID,'actor');
>        echo '<ul>';
>        foreach($actors as $actor) {
>                echo '<li>';
>                echo $actor->name;
>                echo '</li>';
>        }
>        echo '</ul>';
>
> Hope it helps.
>
> -Mike
>
> On Jul 2, 2010, at 12:32 PM, Jimmy Roy wrote:
>
> > sorry for double post, I forgot to change the message object.
> >
> > hi all,
> > I just start to play with custom post type and custom taxonomies.
> > I follow the excellent tutorial by Justin Tadlock everything works fine,
> now
> > I want to display the list of taxonomies associate to my new custom post
> > type (something like wp_list_categories()).
> >
> > for example I create a new custom post type called Movie and a taxonomy
> > called Actor.
> >
> > I want to display in the sidebar :
> > *Actors*
> >
> >   - Brad Pitt
> >   - Georges Clooney
> >   - ...
> >
> > any idea to do that?
> >
> > thank u for your help.
> >
> > Jimmy
> > _______________________________________________
> > wp-hackers mailing list
> > wp-hackers at lists.automattic.com
> > http://lists.automattic.com/mailman/listinfo/wp-hackers
>
> _______________________________________________
> wp-hackers mailing list
> wp-hackers at lists.automattic.com
> http://lists.automattic.com/mailman/listinfo/wp-hackers
>



-- 
http://scribu.net


More information about the wp-hackers mailing list