I have a wordpress site.
I am trying to detect if a user is logged in.
If they are i want to give them a link that will send them to : URL/username.
If the are not i want to send them to URL/wp-login.php
This is what i have tried so far to no avail.
can some one tell me where i am going wrong?
This one everything works except the link extension. I think it a php with in php thing.
It works out side of the if else statment.
[php]
[/php]This one breaks the site:
[php]
<?php
global $userdata;
if ( is_user_logged_in() ) {
echo ‘My Profile’;
} else {
echo ‘Log In’;
}
?>
[/php]
Any help would be great.