Here are two ways to display the registration link if the user is not logged in:
<?php
if ( is_user_logged_in() ) {
//do nothing
} else {
wp_register();
};
?>
or another way to write it:
<?php
if ( !is_user_logged_in() ){
wp_register();//display registration link if not logged in
};
?>
More info on wp_register() here.
Thread Starter
no_ob
(@no_ob)
Thx,
But i was in regards to
<a href="<?php echo wp_lostpassword_url( $redirect ); ?>" title="Retrieve password">Lost your password?</a>
I want that link to be dissapeard when a user has been logged on 🙁
Without the < a href= yadaya it won’t work.
Thats the whole thing about it. Maybe you know a solution ?
Cheers
Hi, try this solution:
Replace
<a href="<?php echo wp_lostpassword_url( $redirect ); ?>" title="Retrieve password">Lost your password?</a>
with
<?php
if ( !is_user_logged_in() ) { ?>
<a href="<?php echo wp_lostpassword_url( $redirect ); ?>" title="Retrieve password">Lost your password?</a>
<?php }
?>
This way the lost your password link only shows up if they’re not logged in, i.e. will disappear if they’re logged in. Good luck!
Thread Starter
no_ob
(@no_ob)
This works great!
Thx mate!
Now i have another stupid thing.
When using login : Wp-LOGIN
At the pw field i get:
? within blocks. You know what i mean ?
This is instead of the normal balls.
You know what happend ?