Numbered Output for Custom Taxonomy
-
I’m trying to number my custom taxonomy, like so:
Custom Post Type = “Books”
Custom Taxonomy = “Series”So that it will print out “Book [number] in Series BlahBlah”, ordered by post date.
It’s making my brain hurt. I’m sure I probably need some kind of walker or… something? This is the code I’m using to output my taxonomy name and link, and it’s inside the post loop:
<?php $terms = get_the_terms( $post->ID, 'series' ); if ( $terms && ! is_wp_error( $terms ) ) : $series_links = array(); foreach ( $terms as $term ) { $series_links[] = $term->name; } $seriestitle = '<h3>Book '. $i .' In Series: <a href="'. home_url( '/' ).'series/' . $term->slug . '" title="' . sprintf(__('View all books in the %s series', 'my_localization_domain'), $term->name) . '">' . $term->name . '</a></h3>'; echo $seriestitle endif; ?>
Any advice is super appreciated!
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘Numbered Output for Custom Taxonomy’ is closed to new replies.