Support » Plugin: Categories Images » Sub categories

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Muhammad


    Sorry for my late reply.

    You can display post categories using the 1st loop example in the plugin docs with get_the_category()

    No worries, thanks for the reply, but I don’t think you’ve answered my questions, it’s about displaying images for sub-categories, can you provide a code example?

    Plugin Author Muhammad


    assume you are in a single post, all you have to do is to get this post categories using get_the_category() then loop on it to display categories images, for example:

     <?php foreach (get_the_category() as $cat) : ?>
     <img src="<?php echo z_taxonomy_image_url($cat->term_id); ?>" />
     <a href="<?php echo get_category_link($cat->term_id); ?>"><?php echo $cat->cat_name; ?></a>
     <?php endforeach; ?>

    Hope I helped.

    Thanks I will test when I get a chance, however the project I needed it for finished ages ago so I had went with a different solution.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Sub categories’ is closed to new replies.