How to have product categories toggled close as default

This topic has 4 replies, 3 voices, and was last updated 8 years, 5 months ago ago by Eva Kemp

  • Avatar: robin2px
    robin2px
    Participant
    October 29, 2015 at 15:02

    How can i have only the current cat open in the toggle categories on the sidebar and all other close ?

    Please, contact administrator
    for this information.
    3 Answers
    Avatar: Robert Hall
    Robert Hall
    Support staff
    October 29, 2015 at 15:19

    Hello,

    You can close first category by default via editing etheme.js file (wp-content/themes/royal/js folder)
    Please find // ! Categories Accordion section in code and comment out the following code
    $this.find('>li').first().find('.open-this').html(minusIcon).parent().addClass('opened').find('ul.children').show();

    Regards,
    Robert Hall.

    Avatar: robin2px
    robin2px
    Participant
    November 15, 2015 at 18:13

    Doesn’t work.

    I managed to close all category by putting this line a comment .

    Line 1771

    $this.find('.current-cat.parent-level0, .current-cat-parent').find('.open-this').html(minusIcon).parent().addClass('opened').find('ul.children').show();

    But i want to have my active category open.

    If my category is
    fruits -> exotic -> banana
    I want top open fruit & exotic

    Put not others category per exemple:
    fruits -> local need top be closed

    Avatar: Eva
    Eva Kemp
    Support staff
    November 16, 2015 at 10:15

    Hello,

    Try to comment the code that my colleague provided, not the one you showed.

    Thank you.

    Regards,
    Eva Kemp.

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