Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $taxonomy = 'albo_regioni';
- // get the term IDs assigned to post.
- $post_terms = wp_get_object_terms( $post->ID, $taxonomy, array( 'fields' => 'ids' ) );
- // separator between links
- $separator = ', ';
- if ( !empty( $post_terms ) && !is_wp_error( $post_terms ) ) {
- $term_ids = implode( ',' , $post_terms );
- $terms = wp_list_categories( 'title_li=&style=none&echo=0&taxonomy=' . $taxonomy . '&include=' . $term_ids );
- $terms = rtrim( trim( str_replace( '<br />', $separator, $terms ) ), $separator );
- // display post categories
- echo $terms;
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement