Support

Account

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

  • That worked, in case this helps somebody else:

    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"><img src="' . $foto . '"/></div>';
    		}
    	}