ashbryant

list terms in a given taxonomy using wp_list_categories

Oct 4th, 2011
200
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.29 KB | None | 0 0
  1.                     <?php
  2.                                             //list terms in a given taxonomy using wp_list_categories  (also useful as a widget)
  3.                         $orderby            = 'name';
  4.                         $order              = 'ASC';            // Sort order for categories (either ascending or descending) 'ASC' or 'DESC'
  5.                         //$child_of         = 278;              // Only show child categories from Parent ID
  6.                         $show_count         = 0;                // 1 for yes, 0 for no
  7.                         $pad_counts         = 0;                // Calculates link or post counts by including items from child categories. 1 for yes, 0 for no
  8.                         $hierarchical       = 1;                // Display sub-categories as inner list items (below the parent list item) or inline. 1 for yes, 0 for no
  9.                         $taxonomy           = 'Industries';
  10.                         $title              = '';
  11.                         $depth              = -1;               // All Categories displayed in flat (no indent) form (overrides hierarchical).
  12.                         $hide_empty         = 1;
  13.                        
  14.                         $args = array(
  15.                           'orderby'         => $orderby,
  16.                           'order'           => $order,
  17.                           'show_count'      => $show_count,
  18.                           'pad_counts'      => $pad_counts,
  19.                           'hierarchical'    => $hierarchical,
  20.                           'taxonomy'        => $taxonomy,
  21.                           'title_li'        => $title,
  22.                           'depth'           => $depth,
  23.                           'child_of'        => $child_of,
  24.                           'hide_empty'      => $hide_empty     
  25.                         );
  26.                        
  27.                     ?>
  28.  
  29.  
  30.  
  31.                         <?php
  32.                          wp_list_categories($args);
  33.                         ?>
Advertisement
Add Comment
Please, Sign In to add comment