WP Magento Fishpig:如何显示子类别


WP Magento Fishpig: How to display subcategory

我正在尝试在magento wordpress集成中显示术语的子类别即:我目前的术语topics在我有子类别的主题中,即 - 有趣、新闻和特殊。

我想做的是wordpress/term/view我需要显示当前术语的所有当前子类别,然后在每个子类别上,我需要显示每个帖子的标题。

这是我到目前为止尝试过的:

<div class="row" id="fisherman">
<div class="col-lg-12">
    <?php $_term = $this->getTerm() ?>
    <?php echo '<pre>';var_dump($_term);echo '</pre>'; die;?>
    <?php if ($_term): ?>
        <h2><?php echo $this->escapeHtml($_term->getName()) ?>  </h2>
        <?php if ($description = $_term->getDescription()): ?>
            <h4 class="description text-white text-center"><?php echo $description ?></h4>
        <?php endif; ?>
        <div class="row">
            <div class="col-lg-4 col-md-4 col-sm-6" id="instagram">
                <span class="ig-follow pull-right" data-id="ab98fe2ce2" data-handle="redsbest" data-count="true" data-size="large" data-username="false"></span>
            </div>
            <script src="<?php echo $this->getSkinurl('dist/instagram/instagram.js'); ?>"></script>
            <script>(function(d,t){var g=d.createElement(t),s=d.getElementsByTagName(t)[0];g.src="//x.instagramfollowbutton.com/follow.js";s.parentNode.insertBefore(g,s);}(document,"script"));</script>
            <?php if ($postList = trim($this->getPostListHtml())): ?>
                <?php echo $postList ?>
            <?php else: ?>
                <p class="note-msg"><?php echo $this->__('There are no posts matching your selection.') ?></p>
            <?php endif; ?>
        </div>
    <?php endif; ?>
    <ul class="list-inline social-media">
        <li><a href="#" target="_blank" class="btn-lg btn-social btn"><i class="fa fa-facebook fa-6"></i></a></li>
        <li><a href="#" target="_blank" class="btn-lg btn-social btn"><i class="fa fa-instagram fa-6"></i></a></li>
        <li><a href="#" target="_blank" class="btn-lg btn-social btn"><i class="fa fa-twitter fa-6"></i></a></li>
    </ul>
</div>

但是这个还没有对任何事情进行分类。我尝试调用$_term->getSubCategory();,它返回 null 这是可能的。.对不起,这里的新手。提前感谢。

$subCateg = $_term->getChildrenTerms();

如鱼猪文档中所述,此方法返回:子术语和如果 $_term 是一个类别,这将返回所有子类别。