• Resolved Lynqoid

    (@lynqoid)


    Hi,

    I have a theme/site that I have developed locally and everything works correctly. As soon as I put the theme up onto staging the is_woocommerce and is_product_category checks return false on product category pages.

    If I switch over to Twenty 17 theme then they work as expected.

    I have tried to track down the issue in my theme, but I cannot figure why the conditional checks would work everywhere else but not on the product category pages and only on the staging environment and not locally.

    Anyone have any ideas how I can try and debug this?

Viewing 3 replies - 1 through 3 (of 3 total)
  • grola

    (@grola)

    is_product_category functions checks taxonomy:

    function is_product_category( $term = '' ) {
    		return is_tax( 'product_cat', $term );
    	}

    You should debug if taxonomy is properly set.

    Thread Starter Lynqoid

    (@lynqoid)

    Thanks, I’ll take a look later.

    So just check if $term is set? I wonder if that is what is_woocommerce() uses too, to see if it’s a woocommerce template? I’ll investigate! ??

    Caleb Burks

    (@icaleb)

    Automattic Happiness Engineer

    If your theme doesn’t declare WooCommerce support, other templates may be used to better fit into your theme.

    Declare WC support if you are making WC enhancements to the theme: https://github.com/woocommerce/woocommerce/wiki/Declaring-WooCommerce-support-in-themes

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Conditional tags not working on staging, but work on local dev.’ is closed to new replies.