我已经用谷歌搜索过了,但是找不到答案。
我已经为帖子创建了一个自定义分类法。
我想在单个帖子页面上列出分配给帖子的分类。例如,当我想要列出一个帖子、标签或类别时,我会这样做:
<?php the_tags('Tags: ', ', ', '<br />'); ?>
<?php the_category(', ') ?>如何在单个帖子页面上列出自定义分类?
发布于 2012-07-05 13:33:16
the_terms( get_the_ID(), 'taxonomy_name', 'myTaxonomy: ', ', ', '<br />' );或
echo get_the_term_list( $post->ID, 'taxonomy_name', 'myTaxonomy: ', ', ', '<br />' );应该能行得通。
https://stackoverflow.com/questions/11338219
复制相似问题