Jump to content

User Login Links - Help Needed


npl

Recommended Posts

Hey,

 

In the top right hand corner of my site, http://borealtrek.com, there is a spot for users to login or register. When the user does this those links still appear. This is very redundant and kind of confusing for them. Is there any way to have it so that when they login it shows them their username which is linked to their information ect.

 

Thanks for the help!

 

This is what it looks like now.

 

This is what I want it to look like.

Link to comment
Share on other sites

In your template file, put this (where appropriate):

 

<?php
$current_user = wp_get_current_user();
if ( 0 == $current_user->ID ) {
   ?>
Login | Register
   <?php
} else {
   ?>
"<?php echo $current_user->user_login; ?>"
   <?php
}
?>

  • Like 1
Link to comment
Share on other sites

Never mind that. I got it to work. lol I assumed html was much different from php. I did not know the two worked together.

 

$current_user = wp_get_current_user();

if ( 0 == $current_user->ID ) {

?>

<a href="http://borealtrek.com/wp-login.php">Login</a><a> | </a> <a href="http://borealtrek.com/wp-login.php?action=register">Register</a>

<?php

} else {

?>

<?php echo $current_user->user_login;?><a> | </a> <a href="http://borealtrek.com/wp-admin/profile.php">Settings</a>

<?php

}

?>

</li>

</ul>

<?php }

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...