Skip to content

Instantly share code, notes, and snippets.

@croosen
Last active August 29, 2015 14:06
Show Gist options
  • Save croosen/aa229fda33046df5cf8b to your computer and use it in GitHub Desktop.
Save croosen/aa229fda33046df5cf8b to your computer and use it in GitHub Desktop.
WordPress - Show taxonomies / categories of custom post type
<?php
$customPostTaxonomies = get_object_taxonomies('foo');
if(count($customPostTaxonomies) > 0)
{
foreach($customPostTaxonomies as $tax)
{
$args = array(
'orderby' => 'name',
'show_count' => 0,
'pad_counts' => 0,
'hierarchical' => 1,
'taxonomy' => $tax,
'title_li' => ''
);
wp_list_categories( $args );
}
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment