How to hide subcategories in main menu in mobile version?

SmolBusinessman

New Member
Hey friends,
I have a problem with collapsing/hiding subcategories and sub-sub-cateogories in the main menu on the mobile version,

For example I'm linking screenshots of kittenrules.com and hokagstore.com

As you can see, in hokagestore.com only the categories of the main menu can be seen while in kittenrules.com , both categories and subcategories can be seen on the mobile version as soon as you open the site.

How can I collapse the subcategories and sub-sub-cateogories like it is done In hokagestore.com ?

Kitten rules, category and subcategories can be seen as soon as you open the site. Best seller, famous cats-(Garfield , grumpy cats), gifts&toys etc.
Screenshot_2018-05-14-18-49-38-272_com.android.chrome.png

Hokagetore mobile version- only categories can be seen when you open the site- best seller, clothing, costumes etc.
Screenshot_2018-05-14-18-46-58-815_com.android.chrome.png
I plan to have many subcategories and they open up as soon as I open the site and that's going to make the site look extremely ugly.

The problem is only in the mobile version. How do I collapse the subcategories?

Thank you.
 
E

Ekaterina Sayapina

Guest
I need the answer too, please help
Please try addind this code snippet:

Desktop:
#category-list .product_cat .cat-item .children{display:none;}
#category-list .product_cat .current-cat-parent .children,
#category-list .product_cat .current-cat .children,
#category-list .product_cat .current-cat-ancestor
.children{display:block;}

Mobile:
.mobile-main-menu .cat_menu-list .cat-item
.children{display:none;}
.mobile-main-menu .cat_menu-list .current-cat-parent
.children, .mobile-main-menu .cat_menu-list .current-cat
.children, .mobile-main-menu .cat_menu-list
.current-cat-ancestor .children{display:block;}
 
Last edited by a moderator:
Top