如何在与该术语关联的节点预告下显示分类术语的描述?
有一个 taxonomy-term.tpl.php 模板,但该模板的内容显示在节点预告片上方,因此描述将出现在节点列表之前。我需要在节点列表和寻呼机行之后将其显示在底部。
节点列表在此模板之后呈现。所以我需要另一种方式来显示它
如何在与该术语关联的节点预告下显示分类术语的描述?
有一个 taxonomy-term.tpl.php 模板,但该模板的内容显示在节点预告片上方,因此描述将出现在节点列表之前。我需要在节点列表和寻呼机行之后将其显示在底部。
节点列表在此模板之后呈现。所以我需要另一种方式来显示它
您需要description
从数组中提取元素content
并在页面上单独呈现。更改taxonomy-term.tpl.php
为如下所示:
<?php
$description = render($content['description']);
hide($content['description']);
?>
<div id="taxonomy-term-<?php print $term->tid; ?>" class="<?php print $classes; ?>">
<?php if (!$page): ?>
<h2><a href="<?php print $term_url; ?>"><?php print $term_name; ?></a></h2>
<?php endif; ?>
<div class="content">
<?php print render($content); ?>
<?php print $description; ?>
</div>
</div>