1

Another question. I have a custom post type called "Articles" Within that I have registered some taxonomies using register_taxonomy called "Article Topics" So my client would pop over to Articles, put in a new article, fill out the publisher, and link to where its published, choose the topic its about...all good.

Except: How do i get those "topics" to display in the sidebar. How do i make a sub-nav out of registered taxonomies? Something like this:

<?php wp_list_categories($args); ?> 

Is this even a good idea? Or should I just say to hell with it, and go back to categories, and ditch the custom post type?

Thanks.

Nadine

0

Have a look at the codex page for wp_list_categories.

$args = array( 'taxonomy' => 'article_topics' );
wp_list_categories( $args );

For the taxonomy terms assigned to individual posts, get_categories also accepts a taxonomy argument.

  • Oh cool! This is my first time using custom post types, so I had no idea that call was tied to them. Now I know. Sorry for the noob question. But thanks. :) – Nadine Sep 9 '11 at 23:47
  • ...any chance that also works with the likes of the_category() within the loop or something similar? ...ie: showing the topics covered in that article. Codex says no, currently hunting around. – Nadine Sep 10 '11 at 0:00
  • get_the_term_list: echo get_the_term_list( $post->ID, 'article_topics', '', ', ', '' ); – Milo Sep 10 '11 at 0:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.