記事が属しているカスタムタクソノミーのタームのスラッグを取得する

Ads

Code

<?php $terms = wp_get_object_terms($post->ID,'foo'); foreach($terms as $term){echo $term->slug . ' ';} ?>
view raw gistfile1.aw hosted with ❤ by GitHub

Screen shot

Note

Description ループ内の記事でカスタムタクソノミーのタームのスラッグを取得する
WordPress Ver. 3.3.1
Via