• Hello, thanks for great plugin!

    Please, how to display only one (or first) category image if the post is assigned to more categories? This is my code in header:

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

    But it is displaying images from all the current post categories.

    Many thanks for help!

    https://wordpress.org/plugins/categories-images/

Viewing 1 replies (of 1 total)
  • I would second this. On a site with multiple categories, and some posts existing in several of those categories, these seems no way to control which category image is used. It’s certainly not using the primary category if you set one using any other plugin, so 1) how does it decide and 2) shouldn’t it try to use the primary category image first?

Viewing 1 replies (of 1 total)

The topic ‘Only one image on post with multiple categories?’ is closed to new replies.