Help please to display images and titles of subcategories on parent category page. I create field with type "Image", return value "Image URL", rule "Taxonomy is equal to category". I add images for categories. How to display this images with category titles and category links in category.php? I found many samples of code for it, but there are not working. Thanks in advance!
Settings screenshot: https://prnt.sc/17s4x2n
This code shows all Categories, but I need show only subcategories of parent category:
<?php
$categories = get_categories(array('taxonomy'=>'category','hide_empty'=>false));
if($categories){
foreach($categories as $cat){?>
<div class="cat">
<div class="name"><a href="<?php echo get_category_link($cat->term_id);?>"><?php echo $cat->name;?></a></div>
<?php if($imgcat=get_field('imgcat', $cat->term_id)){?><div class="image"><img src="<?php echo $imgcat;?>"/></div><?php }?>
</div>
<?php }?>
<?php }?>