gpt4 book ai didi

php - 在 wordpress 上显示分类描述

转载 作者:可可西里 更新时间:2023-11-01 00:55:10 26 4
gpt4 key购买 nike

我正在制作有关电影的网站。分类法用于类型转换。例如:

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 echo term_description(); ?>

另见 https://codex.wordpress.org/Function_Reference/term_description ,您还可以在其中阅读有关两个可选参数的信息 $term_id$taxonomy

关于php - 在 wordpress 上显示分类描述,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47841160/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com