Is it possible to assign specific ID's to wp_nav_menu list items?

For example, if my menu contained links for "Home", "About" and "Contact", could I assign the "Home" list item and ID of "home"?


You can by either using simple JavaScript/jQuery or by extending the menu walker class and here is a nice example for that: adding page id’s to menu

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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