How can set all categories not to auto display sub categories?

This topic has 9 replies, 3 voices, and was last updated 10 years, 2 months ago ago by Eva Kemp

  • Avatar: rjparkerjr
    rjparkerjr
    Participant
    September 28, 2014 at 17:23

    Below is screen shot graphic link showing that the first category will auto display any sub categories. How can I turn off all categories including the first category from auto display sub categories? Please view the screen shot below.

    http://prntscr.com/4r5k74

    In other words I only want that + symbol visible on ALL categories. I want the viewer to have to click the + symbol in order to see the hidden sub categories.

    8 Answers
    Avatar: Robert Hall
    Robert Hall
    Support staff
    September 29, 2014 at 05:40

    Hello,

    To close first category, edit wp-content/themes/royal/js/etheme.js file. Find and comment out line 1389
    etCats.find(‘>li’).first().find(‘.open-this’).html(minusIcon).parent().addClass(‘opened’).find(‘ul.children’).show();

    Regards,
    Robert Hall.

    Avatar: rjparkerjr
    rjparkerjr
    Participant
    September 29, 2014 at 11:09

    I realize that sounds easy for you but I’ve never done any coding. Could you please take a minute and do it for me? I’ve provided you everything you need. I would really appreciate it!

    Ron

    Avatar: rjparkerjr
    rjparkerjr
    Participant
    September 29, 2014 at 12:03

    I just tried to locate that line of code you said needed commented out and that line of code does not exist in that js file?

    Watch this video

    http://helloron.com/royal092914/

    Please help.

    Also how do comment out a line of code?

    Thank you.

    Ron

    Avatar: rjparkerjr
    rjparkerjr
    Participant
    September 29, 2014 at 12:31

    I think this is the section of code you were referring to at line 1517

    var etCats = $(‘.product-categories’);
    $this.addClass(‘with-accordion’)
    var openerHTML = ‘<div class=”open-this”>’+plusIcon+'</div>’;

    I tried this … (added // to the 3rd line of section)

    var etCats = $(‘.product-categories’);
    $this.addClass(‘with-accordion’)
    // var openerHTML = ‘<div class=”open-this”>’+plusIcon+'</div>’;

    That hid both all sub categories even the + signs below?

    Help

    Ron

    Avatar: rjparkerjr
    rjparkerjr
    Participant
    September 29, 2014 at 16:26

    Below are the logins…

    Please, contact administrator
    for this information.
    Avatar: Robert Hall
    Robert Hall
    Support staff
    October 1, 2014 at 20:58

    Hello,

    Sorry for a long delay.
    I’ve commented out code on line 1526 in etheme.js file.

    $this.find('>li').first().find('.open-this').html(minusIcon).parent().addClass('opened').find('ul.children').show();
    

    Now it’s work. You can check it.

    Regards,
    Robert Hall.

    Avatar: rjparkerjr
    rjparkerjr
    Participant
    October 2, 2014 at 09:45

    Perfect. May I suggest you include this in all future theme updates? I see how you commented this line out (Thank you) but I think this layout makes more sense then having the first category in the expanded view by default. To me that makes no sense at all. The first category is the first category just because the first letter is the higher in the alphabet. Why does that suggest that category should be expanded by default while all the others are not. Regardless, thank you.

    Avatar: Eva
    Eva Kemp
    Support staff
    October 2, 2014 at 12:45

    Hello,

    Thank you for the suggestion. We’ve taken this into account and perhaps it will be included in the future updates.

    Thank you.
    Regards,
    Eva Kemp.

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

The issue related to '‘How can set all categories not to auto display sub categories?’' has been successfully resolved, and the topic is now closed for further responses

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