Accordion doesn’t work on Yoothemes UK Navigation Menu
Resolved
Requested:
2 years and 10 months ago
Hi,
I am testing out the Plugin. Issue is that teh accordion doesn’t work on my site. I have put the Navigation Menu and the Page Menu in the sidebar. The Pages menu shows the accordion like it should, but the Navigation menu not.
It seems a another plugin or theme is changing all the the classes within the menu to be versions of uk-nav. I did a quick search and came up with this kit.
If the classes are changed to uk-nav the Advanced Sidebar menu is unable to style and/or add accordion functionality to the menu.
If you can let me know which theme or plugin is changing the classes to uk-nav I may be able to write a filter which will disable this change specifically for the Advanced Sidebar menus.
My theory is that Yootheme is filtering the output of any menu generated using the menu manager which is why the page menu is not being affected.
I took a look at your admin and I can see the menu template but not how it is filtered. Looks like those files are in a vendor dir which I can’t see from WP.
If you can send me a copy of the theme or provide FTP so I can download it myself, I will take a look at where the filters are being added.
I track down the conflict to a filter being added to wp_nav_menu_args.
Yoothemes does not use standard practices for adding filters, so I had to come with a solution that is a little hacky but does the trick. Adding the following filters to your active theme’s functions.php will do the following:
Remove the Yoothemes filters right before an Advanced Sidebar Navigation Menu loads.
Add the Yoothemes filters back in right after an Advanced Sidebar Navigation Menu loads using their own methods.
I have one question left for this maybe you can help me with.
If you go here https://www.gezondheidscentrum-merenwijk.nl/huisartsen/ you see in the right column the Advanced Menu. If you go to for instance to “Kwaliteitszorg” you have to click on arrow to make menu expand. Is there a way to make it expand when clicked on The Item Name?
Hi Marco,
It seems a another plugin or theme is changing all the the classes within the menu to be versions of
uk-nav
. I did a quick search and came up with this kit.If the classes are changed to
uk-nav
the Advanced Sidebar menu is unable to style and/or add accordion functionality to the menu.If you can let me know which theme or plugin is changing the classes to
uk-nav
I may be able to write a filter which will disable this change specifically for the Advanced Sidebar menus.Hi,
Thanks for your answer. It is the Yootheme Pro Theme. It is strange that teh Page Menu works like it should.
Hi Marco,
My theory is that Yootheme is filtering the output of any menu generated using the menu manager which is why the page menu is not being affected.
I took a look at your admin and I can see the menu template but not how it is filtered. Looks like those files are in a vendor dir which I can’t see from WP.
If you can send me a copy of the theme or provide FTP so I can download it myself, I will take a look at where the filters are being added.
Thank you.
Download link for Theme Files Added.
Hi Marco,
I track down the conflict to a filter being added to
wp_nav_menu_args
.Yoothemes does not use standard practices for adding filters, so I had to come with a solution that is a little hacky but does the trick. Adding the following filters to your active theme’s functions.php will do the following:
Have a great weekend!
Hi,
All perfect!
Thank you very much for your fast and quick support and have a nice weekend too!
Hi,
I have one question left for this maybe you can help me with.
If you go here https://www.gezondheidscentrum-merenwijk.nl/huisartsen/ you see in the right column the Advanced Menu. If you go to for instance to “Kwaliteitszorg” you have to click on arrow to make menu expand. Is there a way to make it expand when clicked on The Item Name?
Hi Marco,
This may be accomplished by adding the following custom JavaScript to your site:
More info is available on this thread.
Have a great day!
Great, thank you very much that did the trick!