Skip to content

Instantly share code, notes, and snippets.

@mkdizajn
Created May 20, 2013 12:55
Show Gist options
  • Save mkdizajn/5612047 to your computer and use it in GitHub Desktop.
Save mkdizajn/5612047 to your computer and use it in GitHub Desktop.
wordpress function to get all custom tax list items
<?php
// mk function to get all custom tax list items
// function() -> GET STRING
function mk_custom_tax( $taxstring ){
$terms = get_terms( $taxstring );
$ret = "";
if ($terms) {
$ret = "<div class='taxlist'>";
foreach($terms as $term) {
$ret .= '<p><a href="' . get_term_link($term->slug, $taxstring) . '">' . $term->name . '</a></p>';
}
$ret .= "</div>";
}
echo $ret;
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment