borkolivic

Show cat description in shop loop

Sep 22nd, 2020 (edited)
757
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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);
RAW Paste Data