Page 1 of 1
Wordpress - anyone know how to force the Brands Description?
Posted: Tue Jul 19, 2016 8:23 am
by simonmlewis
We have a theme that sadly does not support the "description" of a brand on the Brands webpage.
I have looked it up but it does look a bit confusing and I can find no definitive "how to" to get it on there.
Any ideas?
We are using the ultimate brands woocommerce plugin.
Re: Wordpress - anyone know how to force the Brands Descript
Posted: Tue Jul 19, 2016 8:48 am
by Celauran
Is it not showing anywhere or just on a particular page? Does it display if you switch to another theme? I looked quickly and the functionality appears to be provided by the plugin, not the theme.
Re: Wordpress - anyone know how to force the Brands Descript
Posted: Tue Jul 19, 2016 8:53 am
by simonmlewis
The idea is that it should show on the Brand page, that shows all products for that particular brand.
...../brands/emile-et-rose/.
As you say, it's supported by the plugin and not the theme. Some themes allow it and some are not configured for it. I guess it's some code that is missing...
Re: Wordpress - anyone know how to force the Brands Descript
Posted: Tue Jul 19, 2016 9:31 am
by Celauran
Don't have a ton of time to look into it right now -- though I can peek tonight if you haven't resolved it. Meanwhile, I can see that brand descriptions are stored in wp_term_taxonomy, so I'd look at
get_terms() and related functions. Hope that gets you pointed in the right direction.
Re: Wordpress - anyone know how to force the Brands Descript
Posted: Tue Jul 19, 2016 9:49 am
by simonmlewis
I found this earler to go on the product page, so each brand will show it's descrption on any product that uses it.
Be useful it I could do similar for the Brands own page?
Code: Select all
add_action( 'woocommerce_single_product_summary' , 'woocommerce_brand_summary', 25 );
/**
* woocommerce_brand_summary
*
* @access public
* @since 1.0
* @return void
*/
function woocommerce_brand_summary() {
global $post;
$brands = wp_get_post_terms( $post->ID, 'product_brand', array("fields" => "all") );
foreach( $brands as $brand ) {
echo __( 'Brand Description', '') . ': ' . term_description( $brand->term_id, 'product_brand' );
}
}