类别段-自定义文章类型Wordpress



使用自定义帖子类型,我需要为我的类(css)使用类别段塞。

<?php 
global $post;
$terms = wp_get_post_terms($post->ID, 'typeresources');
if ($terms) {
$output = array();
foreach ($terms as $term) {
if ($term->term_id != 14)
{
$output[] = '<div class="cat-resources">' .$term->name .'</div>';
}
}
echo join( ' ', $output );
};
?>

我想在我的"cat-resources"类中添加";类段塞

我该怎么做呢?

好了。

global $post;
$terms = wp_get_post_terms($post->ID, 'typeresources');
if ($terms) {
$output = array();
foreach ($terms as $term) {
if ($term->term_id != 14) {
$output[] = '<div class="cat-resources '.$term->slug.'">' .$term->name .'</div>';
}
}
echo join( ' ', $output );
};

最新更新