Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I have another post type which isn't the default one. I have four taxonomies attached to that post type. And I have many tags attached to these taxonomies.

I would like to create a drop down menu that pull automatically all the tags by their taxonomy.

For example: Post type: Culture Taxonomy 1: Books Under that, all the books (tags) Taxonomy 2: Movies Under that, all the movies (tags) etc..

Thanks!

share|improve this question
add comment

1 Answer 1

up vote 1 down vote accepted

wp_list_categories is what you're after. It takes taxonomy as an optional argument.

Example taken from Codex:

<?php 

$taxonomy     = 'genre';
$orderby      = 'name'; 
$show_count   = 0;      // 1 for yes, 0 for no
$pad_counts   = 0;      // 1 for yes, 0 for no
$hierarchical = 1;      // 1 for yes, 0 for no
$title        = '';

$args = array(
  'taxonomy'     => $taxonomy,
  'orderby'      => $orderby,
  'show_count'   => $show_count,
  'pad_counts'   => $pad_counts,
  'hierarchical' => $hierarchical,
  'title_li'     => $title
);
?>

<ul>
<?php wp_list_categories( $args ); ?>
</ul>
share|improve this answer
    
That's great. I changed it to wp_dropdown_categories to get a dropdown list. I have one problem. How do I link to each category like that? I want to choose something from that menu and be linked to the correspond page. –  user1341839 Jul 10 '12 at 9:49
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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