• Resolved natilya

    (@natilya)


    I’ve been trying to figure this out for a while now but I can’t. I have a text link in my header that shows “Login” when a user is not logged in, and “Logout | Dashboard” when they are logged in.

    The problem is, I have the text where I want it when the user is logged in, but when they are not logged in the “Login” text appears too far to the left. I need to style them seperatly, but I don’t know how.

    this is the line of code I’m using.

    <div id="login-form">
    				<?php if ( is_user_logged_in() ) { echo "<a href='" . get_option('siteurl') . "/wp-admin/'>Dashboard</a> |"; } ?> <?php wp_loginout('/index.php'); ?>
    </div><!-- #login-form -->

    I guess I need to add another div in the line somewhere, but I can’t figure out where or even if that’s what I need to do.

    https://zeaks.org is the site, you can see the login link at the top should be more towards the right, if i move it, then the text when the user is logged in is too far right.

Viewing 1 replies (of 1 total)
  • Thread Starter natilya

    (@natilya)

    Ok, I finally figured it out, I just didn’t know where to place the new div tag in the line of code. Here’s what I did in case someone else ever needs to do this.

    <div id="loggedout">
    				<?php if ( is_user_logged_in() ) { echo "</div><div id='loggedin'><a href='" . get_option('siteurl') . "/wp-admin/'>Dashboard</a> |"; } ?> <?php wp_loginout('/index.php'); ?>
    </div><!-- #login-form -->

    added a div for logged in and one for logged out, now I can position the links separately.

Viewing 1 replies (of 1 total)
  • The topic ‘Seperate loginout links’ is closed to new replies.