0

I've registered a Taxonomy named "type" and linked it to the Custom-Post-Type "group".

I simply want to output term archive-linked entrys of the Taxonomy "type".

0

Found this code at the official Wordpress Function Reference: A simple way to get all archive-linked terms of one Taxonomy.

List all the terms, with link to term archive, separated by an interpunct (·):

$args = array( 'hide_empty=0' );

$terms = get_terms('my_term', $args);
if ( !empty( $terms ) && !is_wp_error( $terms ) ) {
    $count = count($terms);
    $i=0;
    $term_list = '<p class="my_term-archive">';
    foreach ($terms as $term) {
        $i++;
        $term_list .= '<a href="' . get_term_link( $term ) . '" title="' . sprintf(__('View all post filed under %s', 'my_localization_domain'), $term->name) . '">' . $term->name . '</a>';
        if ($count != $i) {
            $term_list .= ' &middot; ';
        }
        else {
            $term_list .= '</p>';
        }
    }
    echo $term_list;
}
1
  • Please paste your code directly. Do not use images. Please file an edit and rectify – Pieter Goosen Nov 4 '14 at 4:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.