Closed gbarrow85 closed 5 years ago
Under the Structure dir I make a file called navwalker.php
with this code in it
class Navwalker extends \Walker_Nav_Menu {
//code here
}
then in config/app.php
add this to the autoload array Structure/navwalker.php
Thanks I did the same, I was unsure of the best place to house the file. Maybe something for the doc's custom walkers are pretty common.
I would recommend putting your Walker classes at app/Structure/Walkers/nav-walker.php
and import it in config/app.php
file.
As folder structure is flexible this is a recommendation, but feel free to structure it how it feels right for your project.
What would be the best way to extend the WP Walker_Nav_Menu menu class? I'm trying to create a custom nav walker.