Skip to content

Instantly share code, notes, and snippets.

@charleslouis
Created March 20, 2013 19:57
Show Gist options
  • Save charleslouis/5207925 to your computer and use it in GitHub Desktop.
Save charleslouis/5207925 to your computer and use it in GitHub Desktop.
Wordpress -------------------------------- Display a list of custom taxonomy tems>links
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 .= ' &middot; '; 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