daily pastebin goal
70%
SHARE
TWEET

WooCommerce - Show category description

lorro Jun 11th, 2015 (edited) 587 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2.   // Show category description
  3.   // code goes in functions.php for your child theme
  4.   add_action( 'woocommerce_after_subcategory_title', 'show_cat_description', 12);
  5.   function show_cat_description ($category) {
  6.     $cat_id = $category->term_id;
  7.     $prod_term = get_term($cat_id, 'product_cat');
  8.     $description = $prod_term->description;
  9.     echo '<div class="shop_cat_desc">'.$description.'</div>';
  10.   }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top