• Hi there,

    I’ve added the login/logout/register links using the code below. I’m wondering is there more efficient code that does the same thing? I think it is effecting the loading of the site a bit.

    <div class="header-login">
    	<?php if(is_user_logged_in()): ?>
    	<a href="<?php echo wp_logout_url( get_permalink() ); ?>" title="Logout">Logout</a>
    	<?php endif; ?>
    	<?php if(!is_user_logged_in()): ?>
    	<a href="<?php echo wp_login_url(); ?>" title="Login">Login</a> | <a href="https://www.xxx.com/login/?action=register">Register</a>
    	<?php endif; ?></div>
Viewing 1 replies (of 1 total)
  • Try just using <?php wp_loginout(); ?>. It provides the functionality that you’re replicating there.

Viewing 1 replies (of 1 total)
  • The topic ‘login logout’ is closed to new replies.