我正在制作关于电影的网站。分类法用于演员。例如:
怎么做?这是taxonomy.php的代码:
<?php get_header(); ?>
<div class="module">
<?php get_template_part('inc/parts/sidebar'); ?>
<div class="content">
<header><h1><?php printf( __( '%s', 'mundothemes' ), '' . single_tag_title( '', false ) . '' ); ?></h1></header>
<div class="<?php if(is_tax('dtquality')) { echo 'slider'; } else { echo 'items'; } ?>">
<?php if (have_posts()) :while (have_posts()) : the_post(); ?>
<?php if(is_tax('dtquality')) { get_template_part('inc/parts/item_b'); } else { get_template_part('inc/parts/item'); } ?>
<?php endwhile; endif; ?>
</div>
<?php if (function_exists("pagination")) { pagination($additional_loop->max_num_pages); } ?>
</div>
</div>
<?php get_footer(); ?>
这应该适用于<?php echo term_description(); ?>
另见https://codex.wordpress.org/Function_Reference/term_description,你也可以在这里阅读有关两个可选参数$term_id
and $taxonomy
你可以使用方法term_description
echo term_description($term_id, "your-taxonomy");