【发布时间】:2022-01-23 20:14:28
【问题描述】:
我已经尝试了一些修剪等等,但没有任何效果。
也许我犯了一个错误,你能帮助我吗?代码目前看起来像这样:
$post = get_post();
$terms = wp_get_post_terms($post->ID, 'genre');
if ($terms)
{
$output = '';
foreach ($terms as $term) {
$output .= '<a href="' . get_term_link($term->slug, 'genre') . '">' . $term->name . '</a>, ';
}
};
echo $output;
【问题讨论】: