Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php //Do something if a specific array value exists within a post
- $term_list = wp_get_post_terms($post->ID, 'serie', array("fields" => "all"));
- $terms = get_terms( 'serie' );
- foreach ( $terms as $term ) {
- // The $term is an object, so we don't need to specify the $taxonomy.
- $term_link = get_term_link( $term );
- // If there was an error, continue to the next term.
- if ( is_wp_error( $term_link ) ) {
- continue;
- }
- // Then you can run a foreach loop to show the taxonomy terms infront.
- foreach ( $term_list as $term_single ) {
- echo '<h2><a href="' . esc_url( $term_link ) . '">' . $term_single->name . '</a></h2>';
- }
- }
- ?>
- $terms = get_terms( 'serie' );
- $terms = get_the_terms( get_the_ID(), 'serie' );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement