Conditional login/logout link
-
This seems like something that should be relatively simple, but I can’t sort it out. Is this possibly a result of the placement of the echo tags?
I’m attempting to simply get wordpress to give a login link if the user is logged out and vice versa… I have:
<?php if ( is_user_logged_in() ) { echo '<a href="<?php echo wp_logout_url( get_permalink() ); ?>" title="Logout" class="hunderline">Logout</a>'; } else { echo '<a href="<?php echo wp_login_url( get_permalink() ); ?>" title="Login" class="hunderline">Login</a>'; }; ?>
Viewing 5 replies - 1 through 5 (of 5 total)
Viewing 5 replies - 1 through 5 (of 5 total)
- The topic ‘Conditional login/logout link’ is closed to new replies.