Created
March 20, 2013 19:57
-
-
Save charleslouis/5207925 to your computer and use it in GitHub Desktop.
Wordpress
--------------------------------
Display a list of custom taxonomy tems>links
This file contains hidden or 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
function display_custom_tax_term_list($taxonomy) { | |
$arguments = array( 'taxonomy' => $taxonomy ); | |
$terms = get_terms($taxonomy, $arguments); | |
$count = count($terms); $i=0; | |
if ($count > 0) { | |
$term_list = ('<ul class="unstyled" role="nav">'); | |
foreach ($terms as $term) { | |
$i++; | |
$term_list .= '<li><a href="'. site_url() .'/'. $taxonomy . '/' . $term->slug . '" title="' . sprintf(__('Voir tous les articles étiquettés : %s', 'my_localization_domain'), $term->name) . '"><span class="plus">' . $term->name . '</span></a></li>'; | |
// if ($count != $i) $term_list .= ' · '; else $term_list .= '</p>'; | |
} | |
$term_list .= '</ul>'; | |
echo $term_list; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment