2

どうすればこれを行うことができますか?また、そのサブカテゴリを表示するにはどうすればよいですか?

4

1 に答える 1

7

これをチェックして

<?php $this_category = get_category($cat); ?>
<!-- If category is parent, list it -->
<?php if ($this_category->category_parent == 0) { ?>

<?php } else { ?>
<!-- If category is not parent, list parent category -->
<?php $parent_category = get_category($this_category->category_parent); ?>


<?php } ?>
于 2012-07-04T07:02:32.383 に答える