daily pastebin goal
47%
SHARE
TWEET

WooCommerce - Do not show images for subcategories

lorro Feb 16th, 2017 76 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2.   // WooCommerce - Do not show images for subcategories
  3.   // code goes in functions.php for your child theme
  4.   remove_action( 'woocommerce_before_subcategory_title', 'woocommerce_subcategory_thumbnail', 10 );
  5.   add_action( 'woocommerce_before_subcategory_title', 'custom_subcategory_thumbnail', 10 );
  6.   function custom_subcategory_thumbnail( $category ) {
  7.     if ( $category->parent == '0' ) {
  8.       woocommerce_subcategory_thumbnail( $category );
  9.     } else {
  10.       // do not show a category image
  11.     }
  12.   }
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