Using the nav.php outside roots, i have no "active" class


Im using the nav.php to my theme, but only nav.php to clean the wordpress output for the nav menu, but i notice i have no active class attached to the active menu item, and I walk all the code trying to find the problem, but i dont find it.

Maybe anyone can point some direction in this matter, I understand that the nav.php function works stand alone (or maybe not?)

Thanks in advance.

Given that you’re using this outside of Roots, you’re unlikely to get any help debugging here. Perhaps try on Stack Overflow or one of its equivalents.

Also don’t forget to keep copyright notices and licences in tact when reusing Roots code.

I know its a custom question but maybe was a nav.php file problem, that`s all and maybe someone have the same problem.

And I thought that the Roots group are trying to make every include file a stand alone file, so you can include it wherever you want, but maybe its no the case, so thanks anyway

Thanks again

ps: Don’t worry about the legal stuff im well aware about that and always include them

The code is split across several files to make it more manageable; not so that each file can be used independently. If we made every include standalone then we couldn’t reuse any code, e.g. the utility functions in lib/utils.php.

Sorry, for the delay, you´re right, i found a walker at Github and with that i solve the problema, so thanks for your responses