[Plugin: Taxonomy Images] Trying to list the terms in a taxonomy with their image
-
Thanks for the plugin!
I am using it to attach an image for a taxonomy called “collections”, that will display them museum objects (custom post type)SO I have a page called “collections” where, using a custom page template, I am trying to display all the collections available (ie all terms of the taxonomy “collections”
NB: in fact, this template could also be used for other taxonomies that apply to the museum objects (departments, ethnic group, language, etc)I got this code display the list of terms (collections):
<?php $terms = get_terms("collections"); $count = count($terms); if ( $count > 0 ){ echo "<ul>"; foreach ( $terms as $term ) { echo "<li>" . $term->name . "</li>"; } echo "</ul>"; } ?>
Now I have attached images to the collections, and am trying to display
I tried this, but does not display anything:<?php
$terms = apply_filters( ‘taxonomy-images-get-the-terms’, ”, array(‘taxonomy’ => ‘collections’) );
foreach( (array) $terms as $term) {
echo wp_get_attachment_image( $term->image_id, ” );
echo $term->name;
}
?>
Any idea?
Thanks a lot
- The topic ‘[Plugin: Taxonomy Images] Trying to list the terms in a taxonomy with their image’ is closed to new replies.