-
Dear All
What i want to achieve is to display the login status of a user, in the header of my website using php echo code here is the code am using to achieve this:
PHP12<span><?php echo do_shortcode('[userpro_loggedout]Login | Register[/userpro_loggedout]'); ?></span><span><?php echo do_shortcode('[userpro_loggedin]Welcome, [username]! | Logout[/userpro_loggedin]'); ?></span>When a user has not yet login the following text appear: “Login | Register” and when a user login “Welcome admin! | Logout”.
My problem is that the Login Register and Logout appear just as text! With no link to go to login or register page or to logout the user using this shortcode.
Anyone can help to fix this please?
Hello
I dont know why the code i posted before is messed up here’s the code again:
——————————————————————————————————–
<div class=”container”>
<p>
<span><?php echo $tmq_phone_contact_before;?><?php echo $tmq_phone_contact; ?><?php echo $tmq_phone_contact_after;?></span>
<span><?php echo $tmq_email_contact_before;?><?php echo $tmq_email_contact; ?><?php echo $tmq_email_contact_after;?></span>
<span><i class=”fa fa-lock”></i><?php echo do_shortcode(‘[userpro_loggedout]Login | Register[/userpro_loggedout]’); ?></span>
<span><i class=”fa fa-unlock-alt”></i><?php echo do_shortcode(‘[userpro_loggedin]Welcome, [username]! | Logout[/userpro_loggedin]’); ?></span>
</p>——————————————————————————————————–
Just look at your code and tell me -where do you put ANY links to login or logout? you just using shrocode for displaying text to user if he is logged inor loged out, in your code there is no any code to display/create urls.
so instead of just
<?php echo do_shortcode('[userpro_loggedout]Login | Register[/userpro_loggedout]'); ?>
do something like
<?php echo do_shortcode('[userpro_loggedout]<a href="/login">Login</a> | <a href="/register">Register</a>[/userpro_loggedout]'); ?>
this is so obvious man 🙂
The shortcode given in the documentation didn’t have the link, thats why having problem. thanks a lot.
But what link to use for the LOGOUT?
You must be logged in to reply to this topic.