Advertisement
borkolivic

Show cat description in shop loop

Sep 22nd, 2020 (edited)
1,048
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.34 KB | None | 0 0
  1. function cat_description_homepage ($category)  {
  2.     $cat_id=$category->term_id;
  3.     $prod_term=get_term($cat_id,'product_cat');
  4.     $description=$prod_term->description;
  5.        
  6.         echo '<div class="home_cat_desc">'.$description.'</div>';
  7.     }
  8.    
  9. add_filter ('woocommerce_shop_loop_subcategory_title', 'cat_description_homepage', 10);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement