リンクなしのターム名を出力するコードです。
※タクソノミー名が「news_all」の場合
<?php
$terms = get_the_terms($post->ID, 'news_all');
if ( $terms ) {
echo $terms[0]->name;
}
?>
因みに、リンクありはこちらになります。
<?php the_terms($post->ID,'news_all'); ?>
リンクなしのターム名を出力するコードです。
※タクソノミー名が「news_all」の場合
<?php
$terms = get_the_terms($post->ID, 'news_all');
if ( $terms ) {
echo $terms[0]->name;
}
?>
因みに、リンクありはこちらになります。
<?php the_terms($post->ID,'news_all'); ?>
コメント