Приведенный ниже фрагмент работает нормально, но я жестко запрограммировал идентификаторы родительских категорий . Теперь я ищу способ избавиться от жестко закодированных идентификаторов.
<div class="row">
<?php
$catsArray = array(176, 175); // This line need to be dynamic and the IDs are parent categories.
$categories = get_terms(
array(
'hide_empty' => false,
'include' => $catsArray, 'orderby' => 'include'
) );
foreach ($categories as $key => $cat) {
$cat_thumb_id = get_term_meta( $cat->term_id, 'thumbnail_id', true );
$term_link = get_category_link( $cat->term_id );
?>
<div class="col-md-6">
<div class="sellers-wrap is-revealing">
<figure>
<img src="<?php echo $cat_img; ?>" alt="" class="img-fluid">
</figure>
<div class="sellers-text">
<p><strong><?php echo $cat->name; ?></strong></p>
</div>
</div>
</div>
<?php } ?>
</div>