The filter options aren’t collapsed by default

This topic has 14 replies, 3 voices, and was last updated 4 days, 13 hours ago ago by Andrew Mitchell

  • Avatar: Jacomijn
    Jacomijn
    Participant
    March 23, 2026 at 21:03

    Good evening! I’ve been trying for a few hours now to make the filter collapse by default – so that visitors have to click the + to expand it. I’ve tried everything I could find, but I just can’t get it to work. Can you please help me? Thanks!

    13 Answers
    Avatar: Ayan Rahman
    Ayan Rahman
    Support staff
    March 23, 2026 at 21:14

    Hi,

    Thank you for reaching out to us.

    Theme Options > Woocommerce > Shop page filter > Widget toggles and Widget toggle action.

    Warm Regards,
    The 8Theme Team

    Avatar: Jacomijn
    Jacomijn
    Participant
    March 24, 2026 at 08:12

    Good morning, Ayan,

    Thank you very much for your quick reply! I’ve tried this several times, but the filter remains open by default. What am I doing wrong? See also screen shot. THank you!

    Avatar: Jacomijn
    Jacomijn
    Participant
    March 24, 2026 at 08:12

    Screen shot

    Files is visible for topic creator and
    support staff only.
    Avatar: Andrew Mitchell
    Andrew Mitchell
    Support staff
    March 24, 2026 at 09:12

    Hello, Jacomijn,

    Could you please provide temporary FTP access? We will check what can be done to help you.

    For FTP access, we require the following details: FTP host, FTP username, FTP password, FTP port, and FTP encryption type. If you need assistance in creating these credentials, please reach out to your hosting provider who will guide you through the process.

    Best Regards,
    8Theme’s Team

    Avatar: Jacomijn
    Jacomijn
    Participant
    May 4, 2026 at 17:10

    Hi 8Theme,

    It’s been a while, but I was still not able to fix this issue. I will send the information you need in the private content. Thanks for checking out!

    Content is visible for topic creator and
    support staff only.
    Avatar: Andrew Mitchell
    Andrew Mitchell
    Support staff
    May 5, 2026 at 08:34

    Hello, Jacomijn,
    Thank you for providing access. We have resolved this issue, please check it.
    Best regards,
    8Theme Team

    Avatar: Jacomijn
    Jacomijn
    Participant
    May 5, 2026 at 09:32

    Good morning and thank you for checking! Unfortunately, I don’t think the issue has been resolved. When I go to the product page on my mobile, all the filters are expanded (with no option to collaps). This means I have to scroll a lot before I actually reach a product. I have added 2 sceen shots.

    I would prefer the filters on mobile to be collapsed by default, and only expandable when needed. That way, you can get to the products much faster.

    Could you please take another look? Thanks!

    Files is visible for topic creator and
    support staff only.
    Avatar: Andrew Mitchell
    Andrew Mitchell
    Support staff
    May 5, 2026 at 13:33

    Unfortunately, we are unable to connect to your server via FTP, as we are receiving the following error: “SH-2.0-OpenSSH_9.6p1 Ubuntu-3ubuntu13.15”.

    Therefore, we kindly ask you to add the following custom code to the functions.php file of your child theme.

    add_action( 'wp_enqueue_scripts', function () {
        $js = <<<'JS'
    (function ($) {
        function collapseXstoreSidebarWidgets($scope) {
            var $root = $scope && $scope.length ? $scope : $(document);
    
            $root.find('.etheme-elementor-sidebar .widget-has-toggle').each(function () {
                var $widget = $(this);
    
                $widget.addClass('widget-toggled');
                $widget
                    .find('> ul, > select:not(.select2-hidden-accessible), > .select2-container, > div:not(.widget-title), > p:not(.widget-title), > form')
                    .hide();
            });
        }
    
        $(window).on('elementor/frontend/init', function () {
            [
                'etheme_sidebar',
                'etheme_sidebar_horizontal',
                'etheme_sidebar_off_canvas',
                'woocommerce-etheme_woocommerce_price_filter',
                'etheme_tag_cloud'
            ].forEach(function (widgetName) {
                elementorFrontend.hooks.addAction('frontend/element_ready/' + widgetName + '.default', function ($scope) {
                    collapseXstoreSidebarWidgets($scope);
                });
            });
        });
    
        $(document).on('et_ajax_content_loaded', function () {
            collapseXstoreSidebarWidgets($(document));
        });
    })(jQuery);
    JS;
    
        wp_add_inline_script( 'etheme_elementor_sidebar', $js, 'after' );
    }, 20 );

    Best regards,
    8Theme Team

    Files is visible for topic creator and
    support staff only.
    Avatar: Jacomijn
    Jacomijn
    Participant
    May 5, 2026 at 16:56

    Hello! Thank you for your reply. I’ve added the code to the functions.php file. The filter function still isn’t collapsed by default on mobile devices. Is that correct? Could you please check this? Thanks!

    Avatar: Andrew Mitchell
    Andrew Mitchell
    Support staff
    May 6, 2026 at 06:34

    Hello, Jacomijn,

    Unfortunately, we do not provide support to ensure that our code works on the frontend. Please make sure that all website caches have been cleared.

    Best regards,
    8Theme Team

    Avatar: Jacomijn
    Jacomijn
    Participant
    May 8, 2026 at 10:51

    Hi! The cache has been cleared, but the issue still hasn’t been resolved. Is there another way to set the filters to be collapsed by default on mobile? This is absolutely essential for us, as users currently have to scroll down a very long way through all the expanded filters.

    Avatar: Jacomijn
    Jacomijn
    Participant
    May 8, 2026 at 11:20

    I’ve sorted it out. I found it in the product archive, under ‘Sidebar / Edit filters’, and by unchecking ‘Show widgets’ for mobile. I think it’s working now.

    Avatar: Andrew Mitchell
    Andrew Mitchell
    Support staff
    May 8, 2026 at 14:08

    Hello, Jacomijn,

    Thank you for your message. We are glad to hear that you have managed to resolve the issue.

    If you need any further assistance or have additional questions, please don’t hesitate to contact us.

    Best Regards,
    8Theme’s Team

  • Viewing 14 results - 1 through 14 (of 14 total)

You must be logged in to reply to this topic.Log in/Sign up

We're using our own and third-party cookies to improve your experience and our website. Keep on browsing to accept our cookie policy.