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

CSS Animation, The New Flash?

I’ve used it, so I am not immune to the pull of CSS animation, but what are we doing here folks? Used sparingly, CSS animation is at best a small way to augment conversions (button wiggle), but at worst it is a resource hog that destroys readability and

Review: Google Chrome – StayFocusd ★★★★★

We. Love. This. Chrome extension. Warning: It’s brutal. Stayfocusd is essentially a task manager, not as in manage what task is next, but keeps you focused on your tasks at hand. It blocks websites that waste your time and keep you distracted through a time limit feature. You

WordPress Email Issues

Every now and again we run into issues with WordPress where the email functionality has stopped working. This is usually the result of corrupted core files and/or plugin conflicts. Easy enough to fix: disable plugins or upload a fresh copy of the software and you’re good to go.

Insurency SEO

Glad to have Insurency on board with the Livewire team. We did not make their website but we’ll be doing their Internet marketing. We have a great plan for them and will be proud to be competing alongside huge names like Geico and Progressive. It’s quite the challenge

Why is a short domain name better than a long one?

There are several reasons why a short domain name is generally considered better than a long one: Easier to remember: Short domain names are easier to remember than long ones, which makes it easier for people to find and return to your website. More professional: Short domain names

New Partners

We’ve partnered up with PWH Tech Solutions – one of Gainesville’s premier IT companies – to build some great new apps and web programs. We wish we could tell you all about it but things are pretty hush-hush right now. Suffice it to say that these are huge