By Meagan Hooper on Friday, 17 February 2017
Posted in Technical Issues
Likes 0
Views 230
Votes 0
Hello, we are using some custom code to load a user's avatar and name in various places in our site. However we are having a problem obtaining a link to the user's profile. We have used the following code to try to retrieve the url of a specific user's profile page:

$author = $article->created_by;
$link = ES::user($author)->getProfile();

Unfortunately, this code always generates the following url: http://www.bsmartguide.com/SocialTableProfile
Can you tell me what the proper method is to retrieve the url to a specific user's profile?

Thank You.
Hi there,

Can you try use the code below:


$user = ES::user();

<a href="<?php echo $user->getPermalink();?>"><?php echo $user->getName();?></a>
·
Friday, 17 February 2017 15:22
·
0 Likes
·
0 Votes
·
0 Comments
·
Yes, getPermalink works as opposed to getProfile.

Thank You.

Hi there,

Can you try use the code below:


$user = ES::user();

<a href="<?php echo $user->getPermalink();?>"><?php echo $user->getName();?></a>

·
Friday, 17 February 2017 21:36
·
0 Likes
·
0 Votes
·
0 Comments
·
The method getProfile is to retrieve the user's profile type The correct one to use is getPermalink.
·
Friday, 17 February 2017 21:49
·
0 Likes
·
0 Votes
·
0 Comments
·
View Full Post