This topic has 2 replies, 2 voices, and was last updated 5 years, 5 months ago ago by Olga Barlow
Hello,
Is there a way i can display brands name and not the category name bellow the product images on shop/archive page ?
Thank you,
Hello,
Add the following code to child theme functions.php
add_action('woocommerce_after_shop_loop_item_title', 'et_print_brands', 10);
function et_print_brands(){
global $post, $product;
$terms = wp_get_post_terms( $post->ID, 'brand' );
if(count($terms)>0) {
?>
<p>Brands:
<?php
foreach($terms as $brand) {
$image = '';
$thumbnail_id = absint( get_term_meta ( $brand->term_id, 'thumbnail_id', true ) );
?>
<a href="<?php echo get_term_link($brand); ?>">
<?php
echo $brand->name;
?>
</a>
<?php
}
?>
</p>
<?php
}
}
To disable categories go to Theme Options > Product Page layout > Show product category > Off.
Regards
You must be logged in to reply to this topic.Log in/Sign up