Reply 182139 to: Always open categories widget in sidebar

Avatar: Rose Tyler
Rose Tyler
Support staff
January 17, 2018 at 09:34

Hello,

I hope you are well today and thank you for your question.
It is possible via changes in files. You need to create etheme-child.js file in your child theme with this code:

jQuery(document).ready(function(){
    
    setTimeout(function(){
            var etcats = jQuery('.product-categories');
            var minusicon = '–';
            var subItem = etcats.find('.open-this');
            if (subItem.length) {
                 jQuery(subItem).html(minusicon).parent().addClass('opened').find('> ul, > div.nav-sublist-dropdown').slideDown(100);   
            }
    },100);
        
});

Also, use this code in function.php file of the child theme http://prntscr.com/i1knqa:
wp_enqueue_script('child-theme', get_stylesheet_directory_uri().'/etheme-child.js',array(),false,true);

Regards

Go To The Whole Conversation In Topic
We're using our own and third-party cookies to improve your experience and our website. Keep on browsing to accept our cookie policy.