Add Login link to menu
-
Hello all,
I would like to add a login logout link to my menu. I have used this code for my footer link, but do not know how to make this work with the menu.<?php if ( is_user_logged_in() ) { echo '<a href="' . wp_logout_url( get_permalink() ) . '" title="Logout">Log Out</a>'; } else { echo '<a href="' . wp_login_url( get_permalink() ) . '" title="Login Or Register">Log In</a>'; }
The trick is I would like the login and logout links to take the user back to the page they were previously on when they clicked the login link.
If it is possible to only do this for subscribers, that would be even better.Any suggestions?
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘Add Login link to menu’ is closed to new replies.