Tips and Tricks HQ Support Portal › Forums › WP eMember › Question about adding login status to Nav bar on page › Reply To: Question about adding login status to Nav bar on page
Please bear with me here since I am still pretty new at PHP.
In wordpress i have my header.php file and I would like to add this code in there somewhere to show something like “Login | Register” or if they are already logged in, “Logged in as USERNAME | Edit Profile | Logout”.
The code would be similar to this (with hyperlinks of course). Do I need to make sure my header.php file knows where the wp_eMember_install() function is located? ie, which file it is located in within the eMember plugin files?
if (function_exists(‘wp_eMember_install’))
{
global $auth;
$user_id = $auth->getUserInfo(‘member_id’);
if (!empty($user_id))
{
// Display “Logged in as USERNAME | Edit Profile | Logout”
}
else
{
//Display “Login | Register”
}
}