我试图让所有的子类别都显示在这个循环中,但我正在努力处理代码。这就是我目前所拥有的。
<?php $args=array(\'orderby\' => \'name\', \'order\' => \'ASC\');
$categories=get_categories($args);
foreach ($categories as $cat) { ?>
<dt><a href="#" class="customer-acquisitiontop" id="<?php echo $cat->slug; ?>" data-filter=".<?php echo $cat->slug; ?>"><h2><?= $cat->cat_name; ?></h2></a></dt>
<dd><div class="services">
<?= $categories=get_categories(\'parent\'); ?> /*This should be the children of the parent category */
</div>
</dd>
<?php } ?>
任何帮助都会很好