Support » Plugin: Taxonomy Images » HOW to use Taxonomy Images

  • for all here struggling with implementing this: your theme functions.php:

    function get_term_img_url(){
    if( ! is_plugin_active( ‘taxonomy-images/taxonomy-images.php’ ) ) return;
    $taxonomy = ‘product_tag’;
    $post_id = get_the_ID();
    $terms = wp_get_post_terms( $post_id, $taxonomy ); // Terms for this post
    $custom_taxonomy_images = get_option( ‘taxonomy_image_plugin’ ); // Plugin images data
    if ( empty( $terms ) ) return; // If no terms found, we exit.

    echo ‘<div class=”termiconcontainer”>’;
    // Loop through each term in this post for the defined taxonomy
    foreach ( $terms as $term ) {
    $attachment_id = $custom_taxonomy_images[intval($term->term_id)]; // Get image Attachement ID
    $image = wp_get_attachment_image( $attachment_id, ‘full’ ); // Get image to be displayed
    $url = get_term_link( $term->term_id, $taxonomy ); // Get term URL
    <div class=”termicondiv”>
    name; ?>” href=”<?php echo $url; ?>”><?php echo $image; ?>
    echo ‘</div>’;


    I’ve added this to the short-description.php (copy from woocommerce folder into your theme) like this:

    <div class=”woocommerce-product-details__short-description”>
    <?php echo $short_description; // WPCS: XSS ok. ?>
    <?php echo get_term_img_url()?>

    If you would like to have this added into the archive page, add this to content-product.php like this:

    do_action( ‘woocommerce_after_shop_loop_item_title’ );
    echo get_term_img_url();


    display: flex
    flex-wrap: wrap
    .termicon img
    width: 25px
    heigt: 25px
    font-size: 8px

    CREDIT toh ttps://

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘HOW to use Taxonomy Images’ is closed to new replies.