Return to Snippet

Revision: 48025
at June 22, 2011 05:50 by rgsmith007


Initial Code
//list terms in a given taxonomy using wp_list_categories (also useful as a widget if using a PHP Code plugin)

$taxonomy     = 'eventcategory';
$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        = '';
$empty        = 0;

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

<ul>
<?php wp_list_categories( $args ); ?>
</ul>

Initial URL


Initial Description
Found on the wordpress.org forums, courtesy of snails07

Initial Title
List Wordpress Custom Taxonomies

Initial Tags
wordpress

Initial Language
PHP