0

Does anyone know what is the difference between extending Walker_Nav_menu and walker. I learned about Wordpress Nav Walker and found several different tutorials. Do they extends different classes ?

1 Answer 1

0

Walker_Nav_menu extends walker and includes all the markup for a menu. walker by itself doesn't have any markup, it just handles walking the tree, and needs to be extended to add markup. See the documentation:

Extend the Walker class to use it, see examples below. Child classes do not need to implement all of the abstract methods in the class. The child only needs to implement the methods that are needed.

If you're customising the output of a menu, just extend Walker_Nav_Menu.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.