Make WooCommerce product categories only show images on homepage

Try running your function hooked into the template_redirect action like so:

<?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 ) ;
    }
}

add_action( 'template_redirect', 'fp_categories' );
?>

I’m fuzzy on the logic why this works – I believe otherwise the functions are running before they’re available, but hopefully, someone can further clarify.

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)