Home » Experts Only » WordPress Custom Post Type Category Images : Solved

WordPress Custom Post Type Category Images : Solved

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.

Download, install and activate the plugin. Now you can add images to your categories in any post type (or terms). You can even exclude post types if you want to keep things local to a single category. Now you want to display those images somewhere. There’s plenty of documentation on the author’s site but in our case we needed  to loop through the categories and display the image in a javascript portfolio plugin.

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.

More Web Design Blog Content

New Web Program: Brain Development Maps

Creating braindevelopmentmaps.org was a great opportunity to work on a very interesting site; Shirley came to Livewire with very specific needs. There is nothing ‘typical’ or ‘standard’ about this website, it is in a word, unique. Braindevelopmentmaps.org allows users to view highly detailed brain mapped images online. These

Sullivan Welding Has A New Website

Sullivan welding does excellent custom welding and fabrication. Willum is the owner and manages a crew of expert custom welders. He came to Livewire looking for the best in Gainesville Web Design and we were able to set him up in a great new website in just a

Website To Text

Introducing the Livewire Website to Text Application, a cutting-edge tool that transforms consumer engagement. Imagine having the ability to instantly connect with customers in a personalized way, bridging the gap between your website visitors and your company with ease. With this game-changing feature, you gain access to a plethora

Authority + Trust + Relevance = Rankings

Here you go – the magic formula for ranking on Google. Yes, Yahoo and Bing still matter … even though the third most searched term on Bing is “Google”  – people trying to get back to Google, but they’re still relevant. It’s just easier to focus on Google

New Projects

We’re excited to have new projects coming in on a regular basis. On the menu for the next few weeks are some great opportunities to expand our portfolio and our reach. Lake Butler is electing a new Sheriff soon and we’ll be creating one of the candidate’s websites.

Date for our next Seminar is 4/8

Livewire Seminars are the perfect way to collect everything you need to know to do your own website optimization. We have what it takes to put your site on page 1 and we’ll teach you all of the not-so-secret info. Where to go, what to do, and how