-
In this short tutorial, I am going to explain how to show personalized and specific profile data based on conditions as in this example:
http://userproplugin.com/userpro/profile/test/
How to show a welcome message to current logged in user?
This can be done by utilizing a shortcode similar to this:
PHP1[userpro_loggedin]Welcome back! Happy to see you again![/userpro_loggedin]But now what if we wanted to make it nicer and show the user his display name, current role, and maybe his profile picture. Then you would need to use something like this
PHP1[userpro_loggedin]Welcome, [first_name] [last_name]! Your current user role is [role] and here is your current profile picture [profilepicture round][/userpro_loggedin]HINT:
[userpro_loggedin] shortcode will work only if a user is logged in. So do not worry if he is not logged in, he will not see it.
How to show a custom profile text when a user is viewing another user profile?
You will simply need to change the shortcode to [profile_by_url] to tell the plugin to read the user profile from URL e.g. /profile/test/ (user is test) Here is an example:
PHP1234567[profile_by_url]This is the profile of [first_name] [last_name]! User position is [role] and here is the profile picture[profilepicture round]The user have [followers_count] followers, and have followed [following_count] users already.[/profile_by_url]If you need more info or do not understand anything, please reply and I will extend this tutorial. Thanks for reading!
Ecellent Customization for us. I’m going to give this a try in a day or two. I’m still updating page Content in my website. Thank You For This. I have a few Customization questions for you that I’ll post in Support/How too’s. Blessings. Happy New Years as well!!!
How would you do this without using any shortcode, just php?
Here’s the php way:
http://userproplugin.com/userpro/docs/api.html#userpro_profile_data
The topic ‘How-to: Show personalized profile data’ is closed to new replies.