Skip to content

Instantly share code, notes, and snippets.

@senooat
Last active November 18, 2016 01:17
Show Gist options
  • Save senooat/a657ba3fd52d0272fb110e33f3da99f2 to your computer and use it in GitHub Desktop.
Save senooat/a657ba3fd52d0272fb110e33f3da99f2 to your computer and use it in GitHub Desktop.
$taxonomy = 'タクソノミー名';
$terms = wp_get_post_terms( $post->ID, $taxonomy );
if ( $terms && ! is_wp_error( $terms ) ):
foreach ( $terms as $term ):
$term_id = $term->term_id;
$term_name = $term->name;
$term_slug = $term->slug;
$term_link = get_term_link( $term_id, $taxonomy );
endforeach;
endif;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment