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.

TradePMR has a new website

A really great client – TradePMR – just launched their new super awesome, totally spectacular, mobile responsive website! We worked with their staff for the last 8 weeks to put together an entirely new online experience for their customers. Livewire will be conducting conversion optimization audits over the

What’s New For 2015

Really, we’re not all that sure. We’ll go where the winds blow us but we do have some exciting projects to start out the year right. January will be a big month for us here at Livewire and we hope it only goes up from there. We’re glad

Project Gutenburg

Every heard of it? If not, make sure to check it out. They have tons of books online, free for anybody. Our favorite? A Connecticut Yankee in King Arthur’s Court by Mark Twain http://www.gutenberg.org/ebooks/86 Got a smartphone? Just download a free e-reader and you’re all set. Download the

Good one on Sitelinks

Sitelinks also factor into your ad rank, and can influence the position of your ad on search page. Ad Rank previously took into account your max cost-per-click (CPC) and quality score, and now ad extensions and formats are another component of the calculation. Seems like a no-brainer to implement,

web design north carolina

PHP Is Still King

Hypertext Preprocessor (PHP) is a popular server-side scripting language for building websites. Around 70% of all websites online today use PHP, a computer language that was created in 1994 by Rasmus Lerdorf. Since it is available for everyone to use and alter, PHP is known as an open-source

The Brief Business Guide To Instagram

Instagram is a misunderstood product for most business owners. Isn’t facebook enough? No. Unfortunately you must not only adapt to the changing social media platforms but you have to keep adapting to all the various forms of networkings online. For some it’s fun, for others it’s a necessary