harrymfa
Member
Posted 1 year ago #
I have a taxonomy list using this method:
<? wp_tag_cloud( array(
'taxonomy' => 'my_taxonomy',
'format' => 'list'
) ); ?>
All I want is that list displaying their thumbnails. The plugin page does not explain how to do this clearly and foolproof.
http://wordpress.org/extend/plugins/taxonomy-images/
MichelleLeslie
Member
Posted 1 year ago #
Do you just want the taxonomy images without any links?
If so, this code (from this thread) worked for me.
$categories = get_categories(array( 'taxonomy' => 'series' ));
foreach ($categories as $category) {
$tax_term_id = $category->term_taxonomy_id;
$images = get_option('taxonomy_image_plugin');
echo wp_get_attachment_image( $images[$tax_term_id], 'medium' );
}
harrymfa
Member
Posted 1 year ago #
Thank you. Ideally I would like the images with links, and the title of each. I will try to work something out with this code.
MichelleLeslie
Member
Posted 1 year ago #
If you want the links, try this.
<?php print apply_filters( 'taxonomy-images-list-the-terms', '', array(
'after' => '</div>',
'after_image' => '</span>',
'before' => '<div class="your-class">',
'before_image' => '<span>',
'image_size' => 'thumbnail',
'taxonomy' => 'taxonomy-name',
) ); ?>
harrymfa
Member
Posted 1 year ago #
Thanks again. I tried this code but it didn't return anything. I think I tried something similar to it earlier with the same result. The first code you provided me did return the images of each category but with not markup between them.
tpecop
Member
Posted 6 months ago #
<?php
$terms = apply_filters( 'taxonomy-images-get-terms', null, array(
'taxonomy' => 'model',
) );
if ( ! empty( $terms ) ) {
print ' ';
foreach( (array) $terms as $term ) {
print ' taxonomy ) ) . '">' . wp_get_attachment_image( $term->image_id, 'detail' ) . '' ;
} print ' ';
}
?>
</div>
this actually will show only images. also this code is in tutorial