1

如何在与该术语关联的节点预告下显示分类术语的描述?

有一个 taxonomy-term.tpl.php 模板,但该模板的内容显示在节点预告片上方,因此描述将出现在节点列表之前。我需要在节点列表和寻呼机行之后将其显示在底部。

节点列表在此模板之后呈现。所以我需要另一种方式来显示它

4

1 回答 1

1

您需要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>
于 2011-11-16T13:16:22.740 回答