Displaying Brand Images on Brand Page - by pipandsox

This topic has 8 replies, 4 voices, and was last updated 10 years, 11 months ago ago by Eva Kemp

  • Avatar: pipandsox
    pipandsox
    Participant
    November 29, 2014 at 14:04

    Hi,

    Is there a way to display the brand image uploaded to the brand category on the actual brand page before the products? I’ve put a link in the private content and have been able to display the brand description but can’t seem to display the brand image.

    Thanks

    Please, contact administrator
    for this information.
    7 Answers
    Avatar: Eva
    Eva Kemp
    Participant
    November 29, 2014 at 18:53

    Hello,

    In order to display a thumbnail on a brand page you need add this code in wp-content/themes/legenda/woocommerce/archive-product.php after the line <?php etheme_category_header();?> (line 61):

     <?php
                global $wp_query;
                $cat = $wp_query->get_queried_object();
                $image = '';
                if(empty($cat->term_id) && !is_search()){
                    $image = etheme_get_option('product_bage_banner');
                }else{
                    $thumbnail_id = get_woocommerce_term_meta( $cat->term_id, 'thumbnail_id', true );
                    $image = wp_get_attachment_url( $thumbnail_id );
                }
                
                if($image && $image !=''){
                    ?> 
                        <div class="grid_slider">
                            <img class="cat-banner" src="<?php echo $image ?>" /> 
                        </div>
                    <?php
                } ?>

    Thank you.
    Regards,
    Eva Kemp.

    Avatar: danghaitrieu91
    danghaitrieu91
    Participant
    December 25, 2014 at 09:34

    Hello,

    This is what I was looking for! I have done under the direction of Eva Kemp!
    However, Eva Kemp can guide me how to show Brand Description below brand thumbnail on a brand page was it? I really need it!

    Thanks

    Avatar: Eva
    Eva Kemp
    Participant
    December 25, 2014 at 09:50

    Hello @danghaitrieu91,

    To display description you need add this code in the file wp-content/themes/legenda/woocommerce/archive-product.php (after the code you added for a thumbnail)

    <? if(isset($cat->description) && $cat->description !='' && !is_shop()) {
    	            ?>
    	            	<div class="product-category-description">
    		            	<?php echo do_shortcode($cat->description); ?>
    	            	</div>
    	            <?php
                }
                
                
             ?>

    Thank you.
    Regards,
    Eva Kemp.

    Avatar: danghaitrieu91
    danghaitrieu91
    Participant
    December 25, 2014 at 13:28

    Thanks a lot 😀

    Avatar: Eva
    Eva Kemp
    Participant
    December 25, 2014 at 13:31

    Hello @danghaitrieu91,

    You’re welcome.

    Regards,
    Eva Kemp.

    Avatar: mc9625
    mc9625
    Participant
    January 13, 2015 at 14:17

    Eva the code you suggest for description only works for Categories, not for Brands. (I’m using the Royal theme). Is there anything I miss?

    Avatar: Eva
    Eva Kemp
    Participant
    January 13, 2015 at 15:29

    Hello @mc9625,

    You’ve been replied in other topic.
    Please check it.

    Thank you.
    Regards,
    Eva Kemp.

  • Viewing 8 results - 1 through 8 (of 8 total)

The issue related to '‘Displaying Brand Images on Brand Page’' has been successfully resolved, and the topic is now closed for further responses

We're using our own and third-party cookies to improve your experience and our website. Keep on browsing to accept our cookie policy.