I have the following menu setting, which basically has a parent “Products” menu with two child menu items that I use inside my WordPress 3 menu structure, in particular, inside my sidebar.php file:
<ul id="themenu" class="sf-menu sf-vertical">
<li><a class="sf-with-ul topm" href="#">Products</a>
<li><a href="information">Information</a></li>
<li><a href="parts">Parts</a></li>
</li>
</ul>
I'm not sure what to do with PHP when the user clicks on any of the parameters of the child menu, that is, "Information or parts", I would like to add the CSS class currentMenu to its parent menu class, that is:
<li><a class="sf-with-ul topm currentMenu" href="#">Products</a>
tonyf source
share