This topic has 3 replies, 2 voices, and was last updated 3 years, 5 months ago ago by PYordanovDev
Hi guys,
I want to say that I’m using XStore’s theme for a month now and it’s going great. I’m looking to further extend the functionality of the Brands and have just a simple line of text indicating the brand on the product instead of an image on it.
Here’s what I mean: https://www.loom.com/share/0cdd15b2680849a5884f04757f4d93cc
Hello,
Thank you for using our theme!
Add the below code to child theme functions.php
function etheme_single_product_brands() {
if ( etheme_xstore_plugin_notice() ) {
return;
}
global $post;
$terms = wp_get_post_terms( $post->ID, 'brand' );
$brand = etheme_get_option( 'brand_title',1 );
if ( count( $terms ) < 1 ) {
return;
}
$_i = 0;
?>
<span class="product_brand">
<?php if ( $brand ) {
esc_html_e( 'Brand: ', 'xstore' );
} ?>
<?php foreach ( $terms as $brand ) : $_i ++; ?>
<?php
$thumbnail_id = absint( get_term_meta( $brand->term_id, 'thumbnail_id', true ) ); ?>
<a href="<?php echo get_term_link( $brand ); ?>">
<?php echo esc_html( $brand->name ); ?>
</a>
<?php if ( count( $terms ) > $_i ) {
echo ", ";
} ?>
<?php endforeach; ?>
</span>
<?php
}
Regards
Wow! Thank you! It worked perfectly. You’re awesome and I really appreciate this.
The issue related to '‘Question About Developing A Functionality With Brands’' has been successfully resolved, and the topic is now closed for further responses