tommcfarlin/Collapsible-Menus

Can't get it to work with wordpress

Closed this issue · 2 comments

neys commented

Hello and thank you for a great plugin!

I have an issue with it working in wordpress. I'm not sure it's even possible to get it to work with wordpress' own menu system, but it would be awesome if it could.

You can see the problem here: http://klf.neys.dk/

the menu in the right side is a menu made with wordpress menu-system. The problem is that the link that is supposed to be the "collapser" is called "Foreningshåndbogen" - this link is not visible. Instead if you click on "Medieetik" the menu will expand. This is not really a huge issue, I can live with it being the wrong link that needs clicking to expand, however when the menu then expands it only expands for 1 sec, then it collapses again.

I really can't figure out why. Hope you can help.

If you need more info to understand my problem, please write so! :-)

Sure thing!

The reason it's not working is likely because of the menu having anchor elements inside of the list-item elements. Rather than structuring the menu like this:

<ul>
  <li>
    <a></a>
  </li>
</ul>

Try doing it like this:

<ul>
  <li>
  </li>
</ul>

In WordPress, this can be done with a Custom Navigation Walker or by using a text widget.

Eventually, I'd love to make this a WordPress plugin.

Related #1.

neys commented

Thank you for the quick reply!

It helped a lot with my understanding, however I found this: http://mysitemyway.com/docs/index.php/Collapsible_sidebar_menus

Which seems to work without using text widgets or the custom navigation walker.

Thank you for your time :-)