woocommerce get product category name by id
$id = 42;
if( $term = get_term_by( 'id', $id, 'product_cat' ) ){
echo $term->name;
}
woocommerce get product category name by id
$id = 42;
if( $term = get_term_by( 'id', $id, 'product_cat' ) ){
echo $term->name;
}
Add Product Short Description To Product Category In WooCommerce
function webroom_add_short_description_in_product_categories() {
global $product;
if ( ! $product->get_short_description() ) return;
?>
<div itemprop="description">
<?php echo apply_filters( 'woocommerce_short_description', $product->get_short_description() ) ?>
</div>
<?php
}
add_action('woocommerce_after_shop_loop_item_title', 'webroom_add_short_description_in_product_categories', 5);
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us