Hello,
I’m trying to collapse my left side sub item menu but cannot findout where my mistake is
I’m using integrity and all last x theme update
could you help
thank you
Hi There,
You are using wordpress default widget menu. That is how it works by default.
To collapse it by default, let’s add this custom CSS:
.x-sidebar .sub-menu {display: none;}
.x-sidebar .current_page_item .sub-menu, .x-sidebar .current_page_parent .sub-menu {display: block;}
Then to show the submenu back on click, try adding this custom JS:
jQuery(function($) {
$('#menu-leistungen li a').on( "click touchstart", function() {
$(this).next().toggle();
});
});
Further customization from here would be getting into custom development which is outside the scope of our support. Thank you for understanding.
Hello
thank you for reply
I tried your code but it didn’t work
Hi There,
I see the following error on your console log.
SyntaxError: missing ) after argument list[Learn More] www.multimediaconcept.be:823:49
Could you please try checking your custom JavaScript codes added.
Thanks!
Hello
thank you I cleared the error but still don’t work
is it because it is the shop page (woocommerce) ?
Hi there,
Would you mind clarifying the issue? Because I don’t see any sub menus from your left sidebar’s menu. It’s just standard links which have no hierarchy.
Thanks!
Hello
What I wanted to do is to insert a sub menu under shop in the sidebar navmenu (what is the shop home page woocommerce)
by replicating the category product under shop.
I just added 2 sub item by going to apperance ->menu. (“home cinema” and “cables”)
I tried the code from Lely but didn t work
Hi again,
You can try replacing the previous code with the following code:
jQuery(function($) {
$('.x-sidebar .menu-item-has-children a').on( "click touchstart", function(event) {
event.preventDefault(); $(this).next().toggle();
});
});
Please note that the parent menu item won’t take you to the page it is linked with, the click will only open the sub menu but it will take away it’s functionality to open the page, for example if you click on the shop menu item, this will only open the sub menu but you can’t go to the shop page by clicking on it since it is only opening the sub menu. You can only have 1 feature at a time.
Hope this helps!
thank you I see what you mean I tested it.
so it is not usefull that way
Thank you for understanding.
Cheers!