$myterms = get_terms('taxonomy-name', 'orderby=none&hide_empty');
echo $myterms[0]->name;
foreach
これで、最初のアイテムを投稿すると、次に;を作成できます。ループ:
foreach ($myterms as $term) { ?>
<li><a href="<?php echo $term->slug; ?>"><?php echo $term->name; ?></a></li> <?php
} ?>
そうすれば、それらをすべて投稿したい場合、それらをリストすることができます-私の解決策-foreach内に通常のwordpressループを作成しますが、次のようなものが必要です:
foreach ($myterms as $term) :
$args = array(
'tax_query' => array(
array(
$term->slug
)
)
);
// assigning variables to the loop
global $wp_query;
$wp_query = new WP_Query($args);
// starting loop
while ($wp_query->have_posts()) : $wp_query->the_post();
the_title();
blabla....
endwhile;
endforeach;
ここに非常によく似たものを投稿しました。