Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save chellestein/65033f16bb4181efa17580bd76713f4a to your computer and use it in GitHub Desktop.
Save chellestein/65033f16bb4181efa17580bd76713f4a to your computer and use it in GitHub Desktop.
A Snippet to Display Custom Taxonomies in WordPress With a Shortcode
<?php
function rs_customtax() {
$list = wp_list_categories( array(
'taxonomy' => 'customtax',
'hide_empty' => 0,
'echo' => '',
'title_li' => '',
// other args here
) );
return "<ul>$list</ul>";
}
add_shortcode("rs_customtax", "rs_customtax");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment