I have a wp_nav_menu showing pages, but I’d also like to include a log in/out link, based on the current state of the user, which will redirect them to the home page.
I’ve looked far and wide, but how can I implement this in a wp_nav_menu?
Thanks,
Dennis
2 Answers
Use the wp_nav_menu_items
hook to add a filter which will allow you to add your login / logout link.
Use wp_loginout()
to display a status aware login / logout link. Codex page.