Add login/logout to WP’s built-in menus

Here’s an easy way to add WordPress’s built-in login/logout link to the your menus. I have it coded to work with Genesis’s menus, but you can make this work with any theme by changing the theme_location argument.

2 Comments

  1. Marc on May 30, 2015 at 3:14 am

    This works fine with my primary menu but for some reason it doesn’t work with the secondary menu. I cam even get it working with a third custom menu I set up. Any ideas why the secondary wouldnt work??

    • Dave Kuhar on June 8, 2015 at 7:08 pm

      So your secondary menu is registered and showing up, but the link doesn’t show up there? Also, verify that the secondary menu is actually registered with the name “secondary” – if not, change the name in the line $args->theme_location == ‘secondary’ to fit whatever it’s called.

Leave a Comment