I am trying to display only sub taxonomies with images of current taxonomy in taxonomy page.
I have created custom taxonomies for a custom post type and using the plugin Categories Images to add a images to taxonomies.
I am using this code to display only sub taxonomies in taxonomy page…
<?php $current_term = get_term_by( 'slug', get_query_var( 'term' ), get_query_var( 'taxonomy' ) ); ?>
<?php $cats = wp_list_categories( array(
'child_of' => $current_term->term_id,
'taxonomy' => $current_term->taxonomy,
'hide_empty' => 0,
'hierarchical' => true,
'depth' => 2,
'title_li' => ''
)); ?>
<?php if ($taxonomies) { ?>
<?php foreach (get_taxonomies() as $cat) { ?>
<li><img src="<?php echo z_taxonomy_image_url($cat->term_id); ?>" /><a href="<php get_taxonomy_link($cat) ?>" title="<php $cat->cat_name ?>"></a></li>
<?php } ?>
<?php } ?>
And it’s working fine, but images are not showing.
How to customize wp_list_categories output, to insert in li tag those category images?
get_categories does not fit, because I need those categories are listed hierarchically.