• I am trying to display category image instead of text on my product archive, but looks like something does not work.

    For the theme, I am using Phlox Pro with Elementor Builder

    I am using Category and Taxonomy Image plugin (https://sl.www.ads-software.com/plugins/wp-custom-taxonomy-image/) and I followed all the steps and then included the code in my woocommerce template, here is how it looks:

    `<?php

    if ( ‘default’ == $show_cats = auxin_get_post_meta( $product->get_id(), ‘_product_related_posts_display_categories’, ‘default’ ) ) {
    $show_cats = auxin_get_option(‘product_related_posts_display_categories’, ‘1’ );
    }

    $show_cats = is_shop() ? auxin_get_option(‘product_index_display_category’, ‘1’ ) : $show_cats;

    if (function_exists(‘get_wp_term_image’))
    {
    $meta_image = get_wp_term_image($term->term_id);
    //It will give category/term image url
    }

    if ( auxin_is_true( $show_cats ) && $cat_count > 0 ) {
    echo $meta_image . wc_get_product_category_list( $product->get_id(), ‘, ‘, ‘<em class=”auxshp-meta-terms”>’, ‘</em>’ );
    } ?>`

    I expect the output to be a category image like this (https://prntscr.com/ntthdb) – on the left

    But instead, I get no change (https://prntscr.com/ntthdb) – on the right.

    The page I need help with: [log in to see the link]

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘I changed the template for WooCommerce product for category image but the image’ is closed to new replies.