If you’re a WordPress developer, you’ve probably been here.
You want to use images for your categories, but they are custom taxonomies. Here’s how to solve that issue. We’re using a plugin called “Category Images” by Muhammad Said El Zahlan.
In our file we added the line:
<?php foreach (get_terms(‘v-category’) as $cat) : ?>
Where v-category is the slug of our custom taxonomy.
Next we needed to display the image and the category name.
<img width=”700″ height=”700″ src=”<?php echo z_taxonomy_image_url($cat->term_id); ?>” class=”scale-with-grid wp-post-image” alt=”” />
<h2 class=”nvr-pf-title”><a href=”<?php echo get_term_link($cat->slug, ‘v-category’); ?>”><?php echo $cat->name; ?></a></h2>
Then ending foreach:
<?php endforeach; ?>
That’s it. Displays like a champ.