Created
May 20, 2013 12:55
-
-
Save mkdizajn/5612047 to your computer and use it in GitHub Desktop.
wordpress function to get all custom tax list items
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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