I am trying to set up my site so that my WooCommerce product categories only show images on my home page. Currently I have this:
<?php
function fp_categories() {
if( is_front_page() ) {
add_action( 'woocommerce_before_subcategory_title', 'woocommerce_subcategory_thumbnail', 10 ) ;
} else {
remove_action( 'woocommerce_before_subcategory_title', 'woocommerce_subcategory_thumbnail', 10 ) ;
}
}
?>
This does remove the images, but it does so from every page. I've tried using is_home
instead of is_front_page
, but it didn't help either. Any suggestions?
is_shop()
to check if current page is store's main page. Here you can find other WooCommerce conditional tags.