Reputation: 59
I'm trying to add a link in my header.php file that disappears after a user logs in...So the link only shows for logged out users...Can anyone help with this?
Upvotes: 2
Views: 1023
Reputation: 533
global $user_ID,$current_user;
get_currentuserinfo();
if ( $user_ID ) { .. }
You can get the current user login.
Upvotes: 0
Reputation: 574
In your header.php file place this code
<?php if ( !is_user_logged_in() ) { ... } ?>
Place your link inside the { } where the ... is.
See Function Reference - is_user_logged_in() and its related functions for more information.
Upvotes: 4