Reply To: Sidebars Not Showing On Woocommerce Category Pages

Author
Reply
  • #3510

    Why would you add quotes in function name? That’s why it crashes. Here is the fixed example:

    [scode lang=”php”]add_filter(‘sss_sidebar_activation_1’, ‘sidebar_1_activation’);
    function sidebar_1_activation($active) {
    $active = is_category(‘products’);
    return $active;
    }[/scode]

    This code will show the sidebar only for Products category. But, WooCommerce uses own taxonomy Category with the name ‘product_cat’, so your code will not affect WooCommerce pages. Here is the changed code:

    [scode lang=”php”]add_filter(‘sss_sidebar_activation_1’, ‘sidebar_1_activation’);
    function sidebar_1_activation($active) {
    $active = is_tax(‘product_cat’, ‘name of the product category’);
    return $active;
    }[/scode]

    Replace [b]name of the product category[/b] with the name of the product category.

    Regards,
    Milan