-
How to show the [userpro template=card] of a logged in user? You can show the user=author or a specific user, is their a way to show the logged in user?
Sorry …edit. What I mean is how to:
How to show the [userpro template=card] of a user profile page?
If I have the shortcode [userpro template=card] in the sidebar and I visit the profile page of another user:
http://www.example.com/profile/john it will show in the sidebar my profile card. I would like to have the sidebar show the profile card of the profile user I am visiting in the case have the profile card show John’s card.
HI…yes this is what I am trying to do. In essence to show the card or template (in a sidebar) of the user profile URL that I am viewing/visiting.
I actually kind of solved one part of this issue with the [template=view user=author] added to the sidebar of my site so it now shows the template/card of the author being viewed but I now have an issue in that if the author has not made a POST to the site, the card or template is empty. One a post is made then the card / template displays info.
This is how the card works currently:
PHP1234567891011121314case 'card':if (isset($args['user'])) {$try = get_user_by('login', $args['user']);$user_id = $try->ID;if ($args['user'] == 'author'){$user_id = get_the_author_meta('ID');}} else {if (userpro_is_logged_in()){$user_id = get_current_user_id();}}$user = custom user
or $user = author
else show logged in user CARD. 🙂
I mean to show card for author, on his posts [userpro template=card user=author] for a logged in user, you can juse use [userpro template=card] without user parameter. Hope that helps!
Hi,
Thanks for the help. Yes for the logged in user it works. I guess now what I need to solve is when that logged in user sees another users profile.
For this the user=author works well, the only issue or problem is that until that author has created a post his card or template view remains empty like this image: http://i.imgur.com/KlKrB8b.png.
Once that author makes a post then his display name, country badge etc… are shown. Is their a workaround for this so that the author=user displays the authors information (name, badge etc..) before the first post takes place?
Which code are you using ? which shows no info if user has no posts?
On the template=view user=author it shows just the default photo (when a post is created then is shows display info as well).
For the template-card user=author it is completely empty (shows nothing at all until the first post is published). Then the card shows user info.
Which code are you using ? which shows no info if user has no posts? The user=author should work only where an AUTHOR is identified. I think there’s a bit of misunderstanding in the implementation. That’s why I need to know which code are you trying and where?
Right now I have this shortcode in the sidebar:
[userpro template=view user=author header_only=true no_style=true margin_bottom=0px]
It works perfectly in all scenarios except when the author has not added a post in which case the template is empty.
I have version 1.71 userpro installed.
But that’s not supported to work on profile page (To show profile owner card) – because the author of profile page is admin always. I will do more tests about this.
Yes..it actually works very well and provides amazing flexibility as site owners can actually show profile view and card info of profile owners they visit in the sidebar.
The one small issue that holds this back from working perfectly is the fact that the display information does not appear until a first post is made.
I’m having the same issue with view profile… Userpro is built for wordpress this should have been addressed and solved it’s quit simple users need to be shown on author.php correctly even if they haven’t made a post. There’s a theme that does this well and it’s no where as good as userpro so it’s a small fix for you guys. This will for sure hold back userpro there’s been many issues discussed here on this topic… Please fix this in your next update it’s really important for wordpress profiles.
Please, write shortcode you try, and what you expect from it – and what it does not do. I am a programmer, I understand coding, not replies 😀
You must be logged in to reply to this topic.