该网站的beta版本为:beta2。dixiestarkhome。com,上下文的页面为:http://beta2.dixiestarkhome.com/taxon/upholstery/sofas-settees/
我的习惯分类法是“分类单元”,沙发是室内装潢的产物。
我想找到父分类单元,然后对该父分类单元执行wp\\u list\\u分类。
这是运行分类单元列表的代码:
<div id="nav" class="bottom-border">
<?php
//list terms in a given taxonomy using wp_list_categories (also useful as a widget if using a PHP Code plugin)
$taxonomy = \'taxon\';
$orderby = \'name\';
$show_count = 0; // 1 for yes, 0 for no
$pad_counts = 0; // 1 for yes, 0 for no
$hierarchical = 1; // 1 for yes, 0 for no
$title = \'\';
$args = array(
\'taxonomy\' => $taxonomy,
\'orderby\' => $orderby,
\'show_count\' => $show_count,
\'pad_counts\' => $pad_counts,
\'hierarchical\' => $hierarchical,
\'title_li\' => $title,
\'depth\' => \'1\'
);
?>
<ul class="navigation-list">
<?php wp_list_categories( $args ); ?>
</ul>
<?php
$term = $wp_query->queried_object;
//list terms in a given taxonomy using wp_list_categories (also useful as a widget if using a PHP Code plugin)
$args2 = array(
\'taxonomy\' => $taxonomy,
\'orderby\' => $orderby,
\'show_count\' => $show_count,
\'pad_counts\' => $pad_counts,
\'hierarchical\' => $hierarchical,
\'title_li\' => $title,
\'depth\' => \'1\',
\'child_of\' => $term->term_id
);
?>
<ul id="sub_nav">
<?php wp_list_categories( $args2 ); ?>
</ul>
如果我在UpHosty页面上,它可以很好地显示孩子们。如果我在沙发上,它只会说“没有类别”
总而言之,我需要找到父分类单元,然后列出子分类单元。。。
想法?