• Resolved chief_wolfinjo

    (@chief_wolfinjo)


    Hello,

    I tried everything but for some reason all filter widgets are not working, or in other words they are not showing in sidebar. Other widgets works.

    I have contacted the developer on themeforest where i bought the theme, and he says that this is not a problem in theme, and it is problem in WooCommerce.

    So my last hope is here…

    i searched in theme files and i found one part of the code which creates problems with widgets.

    function hc_after_setup_theme(){
        add_theme_support('woocommerce');
    }
    function hc_remove_woocommerce_default_shop($args, $post_type) {
        if (class_exists('WooCommerce')) {
            if ( $post_type == "product" ) {
                $args['has_archive'] = true;
            }
        }
        return $args;
    }
    add_action('after_setup_theme', 'hc_after_setup_theme');
    add_filter('register_post_type_args', 'hc_remove_woocommerce_default_shop', 20, 2);

    if i delete this: add_filter('register_post_type_args', 'hc_remove_woocommerce_default_shop', 20, 2);`

    then filter widgets works, but unfortunately the page layout changes drastically after that, which again creates a problem for me.

    so i dont know how to fix it…

    can you help me

    Thank you

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Support RK a11n

    (@riaanknoetze)

    Hi there,

    Just to make sure: If you temporarily switch to a default theme like TwentyNineteen or Storefront, do those filters work then?

    The reason I’m asking is that if it works on those themes but not with the Themeforest theme then it would absolutely confirm that the code you found in in the TF theme is causing a conflict. Armed with that information, you could then go back to the Themeforest developer with your findings…

    Thread Starter chief_wolfinjo

    (@chief_wolfinjo)

    Hello,

    Thank you for the reply. Yes it works if I change to a default theme like TwentyNineteen.

    I went to research further more, and found out that filter widgets work normally on all other pages except for the shop page.

    For example it works on product-category page, but that page has archive class in body, while shop page does not have archive class in body.

    is it important to have archive class in body for shop page ? or what classes needs to have ?

    and can you maybe check the shop if I send you url of the shop by pm ?

    Thank you

    Thread Starter chief_wolfinjo

    (@chief_wolfinjo)

    please reply

    Thank you

    Plugin Support AW a11n

    (@slash1andy)

    Automattic Happiness Engineer

    Hey there!

    This is definitely something that would need to be asked of your theme developer, as it is working properly with a theme that is not modifying the widget areas.

    Since this is a few weeks old, and about customization, I am going to mark as resolved. A lot of people have found help in the Advanced WooCommerce group with things like this, so I would recommend checking there, or we highly recommend contacting one of the services on our Customizations page (https://woocommerce.com/customizations/)

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Filter widgets not showing’ is closed to new replies.