Forum Replies Created

Viewing 1 replies (of 1 total)
  • Dear @titodevera

    Thanks for the help. I’m trying to show the brands logo-thumbnail instead of the brand name (still with the link).

    How do I have to modify your code?

    add_action( 'woocommerce_before_shop_loop_item_title', 'aq_display_brand_before_title' );
     function aq_display_brand_before_title(){
       global $product;
       $product_id = $product->get_id();
       $brands = wp_get_post_terms( $product_id, 'pwb-brand' );
       $attachment_src = wp_get_attachment_image_src( $attachment_id,'full' );
       foreach( $brands as $brand ) echo '<a href="'.get_term_link($brand->term_id).'">'.$brand->name.'</a>';
     } 

    I wasn’t able to reproduce it with following terms. It shows always empty or error.

    
    $attachment_id = get_term_meta( $brand->term_id, 'pwb_brand_image', true );
    $attachment_src = wp_get_attachment_image_src( $attachment_id,'full' );
    

    Thanks for the help.

    Greetings Elìa

Viewing 1 replies (of 1 total)