Support

Account

Home Forums General Issues Displaying image in WooCommerce product category. Reply To: Displaying image in WooCommerce product category.

  • Thanks for reply maira,
    Yes the field name is $foto. but its not working.
    Actually i want to add a label on the Product category images like this
    http://prntscr.com/gefwfd

    I have set the setting below way…

    1. Set file name $foto

    2. Return Value set to Image URL http://prntscr.com/geft8t

    3. set rule, Taxonomy Term -> is equal to -> Product Categories
    http://prntscr.com/gefrjw

    4. The Image showing ok on the product category fields http://prntscr.com/geg1s2

    5. added your code to functions.php

    if ( is_product_category() ) {
    // vars
    $queried_object = get_queried_object();
    $taxonomy = $queried_object->taxonomy;
    $term_id = $queried_object->term_id;
    $foto = get_field( 'foto', $queried_object );
    $foto = get_field( 'foto', $taxonomy . '_' . $term_id );
    if( get_field('foto', $taxonomy . '_' . $term_id) ) {
    echo '<div class="cat-banner"></div>';
    }
    }

    i am a newbee, Sorry for bothering you. Would you like to suggest me what else need to do.

    Thanks in advance