WooCommerce Brands: Display Brands @ Shop & Category Pages

A freelance client hired me to display each product brand in the shop/product archive pages. The WooCommerce Brands plugin, in fact, only adds these in the Single Product Page.

So, this is how it’s done. Enjoy!

Display WooCommerce Brands @ Loop/Shop Pages

PHP Snippet: Display “Brands” @ WooCommerce Shop & Product Archives – WooCommerce Brands Plugin

/**
 * @snippet       Display "Brands" @ Shop/Loop - WooCommerce
 * @how-to        Get CustomizeWoo.com FREE
 * @author        Rodolfo Melogli
 * @compatible    WooCommerce 5
 * @community     https://businessbloomer.com/club/
 */

add_action( 'woocommerce_after_shop_loop_item_title', 'bbloomer_show_woocommerce_brands_loop', 8 );

function bbloomer_show_woocommerce_brands_loop() {
	global $post;
	echo get_brands( $post->ID );
}

Where to add custom code?

You should place custom PHP in functions.php and custom CSS in style.css of your child theme: where to place WooCommerce customization?

This code still works, unless you report otherwise. To exclude conflicts, temporarily switch to the Storefront theme, disable all plugins except WooCommerce, and test the snippet again: WooCommerce troubleshooting 101

Related content

  • WooCommerce: Custom Add to Cart URLs – The Ultimate Guide
    In WooCommerce you can add a product to the cart via a custom link. You just need to use the “add-to-cart” URL parameter followed by the product ID. This tutorial will show you how to create custom URLs to add simple, variable and grouped products to the cart – as well as defining the add […]
  • WooCommerce Visual Hook Guide: Single Product Page
    Here’s a visual hook guide for the WooCommerce Single Product Page. This is part of my “Visual Hook Guide Series“, through which you can find WooCommerce hooks quickly and easily by seeing their actual locations (and you can copy/paste). If you like this guide and it’s helpful to you, let me know in the comments! […]
  • WooCommerce: Disable Variable Product Price Range $$$-$$$
    You may want to disable the WooCommerce variable product price range which usually looks like $100-$999 when variations have different prices (min $100 and max $999 in this case). With this snippet you will be able to hide the highest price, and add a “From: ” prefix in front of the minimum price. At the […]
  • WooCommerce: Hide Price & Add to Cart for Logged Out Users
    You may want to force users to login in order to see prices and add products to cart. That means you must hide add to cart buttons and prices on the Shop and Single Product pages when a user is logged out. All you need is pasting the following code in your functions.php (please note: […]
  • WooCommerce: How to Fix the “Cart is Empty” Issue
    For some reason, sometimes you add products to cart but the cart page stays empty (even if you can clearly see the cart widget has products in it for example). But don’t worry – it may just be a simple cache issue (and if you don’t know what cache is that’s no problem either) or […]

Rodolfo Melogli

Business Bloomer Founder

Author, WooCommerce expert and WordCamp speaker, Rodolfo has worked as an independent WooCommerce freelancer since 2011. His goal is to help entrepreneurs and developers overcome their WooCommerce nightmares. Rodolfo loves travelling, chasing tennis & soccer balls and, of course, wood fired oven pizza. Follow @rmelogli

42 thoughts on “WooCommerce Brands: Display Brands @ Shop & Category Pages

  1. Hi,

    It does not work for me. I am using Kadence Shop Kit to showing for my brands.
    And when add this code it will be some trouble in my store and wordpress want me to trouble shooting.

    Can this be the Kadence Shop Kit Plugin that the code does not work with? Thanks!

    1. Not sure. If you disable Kadence and enable WooCommerce Brands, does it work?

  2. It still works! Also adjusted it myself to make it above the product title which is awesome. But how do you remove the link to the brand or just link to the product versus the brand page? I know custom code. Reaching out for quote.

    1. Cool! To remove the link, you need a workaround with remove_action as the whole block of content is wrapped into a link. Thanks for reaching out

  3. Hi Rodolfo,

    Is it possible to show brand thumbnail on the top side corner of the products in the shop page? The brand thumbnail (logo) will be stacked on top of the product thumbnail. Is it doable with this plugin or doable at all? Appreciate your advise!

    Thank you!

    1. Hi Jimmy thanks so much for your comment! Yes, this is definitely possible, but I’m afraid it’s custom work. If you’d like to get a quote, feel free to contact me here. Thanks a lot for your understanding!

  4. Hi!
    Is it possible to have it over the product title?

  5. Hello,
    Thank you for your help. It works perfectly. Is it possible to display only the “parent” brand ?

    1. Hi Karim, thanks so much for your comment! Yes, this is definitely possible, but I’m afraid it’s custom work. If you’d like to get a quote, feel free to contact me here. Thanks a lot for your understanding!

  6. Hey
    How to set logo image above title in product page?

    1. Hi Bar, thanks so much for your comment! Yes, this is definitely possible, but I’m afraid it’s custom work. If you’d like to get a quote, feel free to contact me here. Thanks a lot for your understanding!

  7. Thanks! works great, is there a way to make it:

    Image
    Brand
    Title
    Price

    Currently Brand is after the title.

    1. Ivan, thanks so much for your comment! Yes, this is definitely possible, but I’m afraid it’s custom work. If you’d like to get a quote, feel free to contact me here. Thanks a lot for your understanding!

  8. Hi, it doesn’t work, it gets a reply while uploading the code:

    Uncaught Error: Call to undefined function get_brands() in wp-content/themes/astra/functions.php:168
    Stack trace:
    #0 wp-includes/class-wp-hook.php(287): bbloomer_show_woocommerce_brands_loop(”)
    #1 wp-includes/class-wp-hook.php(311): WP_Hook->apply_filters(”, Array)
    #2 wp-includes/plugin.php(478): WP_Hook->do_action(Array)
    #3 wp-content/plugins/woocommerce/templates/content-product.php(57): do_action(‘woocommerce_aft…’)
    #4 wp-includes/template.php(732): require(‘/home/sinkevic/…’)
    #5 wp-content/plugins/woocommerce/includes/wc-core-functions.php(283): load_template(‘/home/sinkevic/…’, false)
    #6 wp-conte

    1. What Brands plugin are you on?

  9. Brilliant, thank you! Just added it to my store and it still works.

    1. Yay!

  10. Dear Rodolfo,
    thank you for this snippet, it is really helpful. Somehow the brand name appears below all the other information (price, price per liter, shipping …), just above the buy-button. Is there an easy way to make it appear right below the product name? Thank you.
    David

    1. Hi David, thanks so much for your comment! Yes, this is definitely possible, but I’m afraid it’s custom work. If you’d like to get a quote, feel free to contact me here. Thanks a lot for your understanding!

  11. You can put the brand image instead of the title, in the same place with some code

    1. Cool. Share it here maybe?

  12. Hello,

    Your code doesn’t work at all, I bought The WooCommerce Brands plugin because of your article, so I activate the plugin, add your code in the child theme function.php but nothing happen. Can you try to help me ? I will be very thankful !

    I’m using :

    WordPress : 5.2.3
    Elementor Pro : 2.6.5
    WooCommerce : 3.7.0

    1. Do you get any PHP error?

  13. Hello,

    Unfortunately this code doesn’t work with my site. It says: the site is experiencing technical difficulties.
    I also tried with twenty seventeen theme (no error but no brands showing). Any ideas ?

    I am using:

    Theme: xstore
    Wordpress: 5.2.2
    Woocommerce: 3.6.4
    Php: 7.1

    1. Hi there, what error do you get exactly? Please copy/paste here the part of the WordPress email notification where it describes the issue. Thank you!

    2. Here is the picture. The page width got shorten and there is only one product showing.

      Error log:

      Fatal error: Uncaught Error: Call to undefined function get_brands() in ...

      https://shrani.si/f/1b/3l/98C8i5T/11.png

      1. Hi there, are you using the official WooCommerce Brands plugin?

  14. Hey! Still working & amazing – thank you! One question – what do I need to add to the code to be able to style the brand name? I was hoping to reference it and add the CSS to the live editor ๐Ÿ™‚ Thank you!

    1. Hello Sarah! Just add an HTML class to the PHP and then reference it in your CSS:

      echo '<div class="loop-brands">' . get_brands( $post->ID ) . '</div>';
      
  15. Hi Rodolfo, thank you very much for this code. Would it be possible to link the brand title to the actual product instead of the brand archive? Thank you again!

    1. Hello Rika, thanks so much for your comment! Yes, this is definitely possible, but I’m afraid it’s custom work. If you’d like to get a quote, feel free to contact me here. Thanks a lot for your understanding!

  16. hello sir,
    I’m using perfect woocommerce brands plugin to display my brands . when somebody click on brand logo i just need the category of that brand to be displayed am new to wordpress please help me

    1. Hey Anjana, thanks for your comment! Try ask the plugin developers please ๐Ÿ™‚

  17. Hi Rodolfo, Many thanks for sharing with us these code snippets.
    It has really helped me out a lot. Your site is officially my “go-to” site for everything woocommerce.
    I need some help here. I have browsed through lots of materials, I’ve not gotten any solution.

    I want to show my custom taxonomies on the shop page, just like the way you’ve shown brands above.
    Please, how do I go about it.
    I have no experience in coding, please.

    Many thanks, standing by.

    1. Hello Prince – thanks so much for your comment! Yes, this is possible – but unfortunately this is custom work and I cannot provide a complementary solution here via the blog comments. If you’d like to get a quote, feel free to contact me here. Thanks a lot for your understanding! ~R

  18. Still works.
    Many Thanks ๐Ÿ™‚

    Best
    David

    1. Thank you David ๐Ÿ™‚

  19. Hi Rodolfo – is there an elegant way to hide the entire brand loop if there is no brand assigned?

    We have a few products that are gift packs and contain items from a few different makers, so we generally leave the name blank. However I noticed it has been throwing errors in the error_log when these products are listed in the category loop (I think).

    1. Hey Justin, thanks for your comment! Yes, you can just check if “get_brands” exists before echoing it. Hope this helps ๐Ÿ™‚

  20. Thanks!! Just what I needed. I find myself landing on your site more and more these days. Really appreciate your work!

    1. Thank you so much Justin ๐Ÿ™‚

Questions? Feedback? Customization? Leave your comment now!
_____

If you are writing code, please wrap it like so: [php]code_here[/php]. Failure to complying with this, as well as going off topic or not using the English language will result in comment disapproval. You should expect a reply in about 2 weeks - this is a popular blog but I need to get paid work done first. Please consider joining the Business Bloomer Club to get quick WooCommerce support. Thank you!

Your email address will not be published. Required fields are marked *