在wordpress上显示分类法描述

问题描述 投票:1回答:2

我正在制作关于电影的网站。分类法用于演员。例如:

enter image description here

很酷吗? :D但我想在此页面上显示说明。我在谈论这个:enter image description here

怎么做?这是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 wordpress taxonomy
2个回答
1
投票

这应该适用于<?php echo term_description(); ?>

另见https://codex.wordpress.org/Function_Reference/term_description,你也可以在这里阅读有关两个可选参数$term_idand $taxonomy


0
投票

你可以使用方法term_description

echo term_description($term_id, "your-taxonomy");

© www.soinside.com 2019 - 2024. All rights reserved.