Skip to content

Instantly share code, notes, and snippets.

@guzuri
Created October 4, 2013 04:18
Show Gist options
  • Save guzuri/6820879 to your computer and use it in GitHub Desktop.
Save guzuri/6820879 to your computer and use it in GitHub Desktop.
カスタムタクソノミーの出力(リンク無し)
<?php
//hoge:出力したいカスタムタクソノミー
$tarms = get_the_terms( $post -> ID ,'hoge' );
foreach ( $tarms as $tarm ) {echo $tarm -> name;}
//'category''post_tag'でそれぞれdefaultカテゴリーとタグも利用可
//$termsの[数値]はどーもカテゴリID諸々が入る様で[0]とかでは空っぽ。
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment