Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- // WooCommerce - Do not show images for subcategories
- // code goes in functions.php for your child theme
- remove_action( 'woocommerce_before_subcategory_title', 'woocommerce_subcategory_thumbnail', 10 );
- add_action( 'woocommerce_before_subcategory_title', 'custom_subcategory_thumbnail', 10 );
- function custom_subcategory_thumbnail( $category ) {
- if ( $category->parent == '0' ) {
- woocommerce_subcategory_thumbnail( $category );
- } else {
- // do not show a category image
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement