Always open categories widget in sidebar

This topic has 2 replies, 2 voices, and was last updated 6 years, 3 months ago ago by Rose Tyler

  • Avatar: schnetzi
    schnetzi
    Participant
    January 16, 2018 at 20:18

    Hello,

    I would like to have the categories in my sidebar always expanded. Is that possible?
    Thank you very much in advance!

    Please, contact administrator
    for this information.
    1 Answer
    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

  • Viewing 2 results - 1 through 2 (of 2 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.