代码有错误,我想。。。因为get\\u术语支持数组作为参数<因此,我认为最好的方法是:
1-创建模板生成器术语。php
2-使用以下内容将其包含在页面中:
<?php get_template_part(\'template\',\'composers-terms\') ?>
最后,在新创建的文件中输入:
<?php
/* Template Name: List of composers or \'List of interprets\' */
$terms = get_terms(array(
\'taxonomy\' => \'composers\', // make sure it is the taxonomy key passed at the register_taxonomy function.
\'hide_empty\' => false
);
foreach ( $terms as $term ) :
echo $term->name;
endforeach;
?>