0

Here is my problem. I'm working on a video website and we have different categories for each video. We have setup a custom post type called "videos" in which we use the different taxonomies to categorize them. We use "category" icons to represent each video category, but I can't figure out how to display them outside the archives page.

I'm displaying a list of the latest videos added and right next to the title I want to display a small icon so they can be identified a lot easier. The plugin I'm using to get the images is called "Categories Images.

Is there a way to display the icon outside the archives page?

Thanks!

0

I'm not familiar with that plugin, but I know that you can do exactly this with Taxonomy Images. In fact, there's a recent (resolved) support request with exactly the same question.

0

Ok I've finally figured it out so I will post the answer to my very own question for anyone who might be looking for the same thing.

<?php
print apply_filters( 'taxonomy-images-list-the-terms', '', array(
'after'        => '</div>',
'after_image'  => '</span>',
'before'       => '<div class="my-custom-class-name">',
'before_image' => '<span>',
'post_id'      => $post->ID,
'taxonomy'     => 'YOUR-TAXONOMY',
) );
?>

Basically replace "YOUR-TAXONOMY" with whatever you custom taxonomy is. This will only list those icons related to the post. Have in mind that you will need the "Taxonomy Images" plugin in order to make this work.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.