*

pitbull

  • ***
  • 98 posts
Link to users's public profile - need Help
« on: January 27, 2018, 12:53:15 PM »
Hi i created a link ( MY PROFILE ) to the header bar that links to the logged in user public profile (file: user-public-profile.php). The link works fine on all pages but not when i visit other users pubic profile pages.
Let me explain more:

There are for example 2 users registered on the site. John and Anna. I as John am Logged in to the site and click the link (MY PROFILE). It works fine and point to my public profile page. BUT when i visit Anna's public profile then the link (MY PROFILE) points now to Anna's public profile page and vice versa, when i log in as Anna and visit John's public profile then for only this specific page the link stop to work as it should and point again to John's public profile page !!!!. The link (MY PROFILE) should be always point to MY profile page no matter what page i visit.

This is the code i use to get the loggedin user public page URL:

Code: [Select]
<a href="<?php echo osc_user_public_profile_url($id null); ?>">MY PUBLIC PROFILE</a>i also tried
Code: [Select]
<a href="<?php echo osc_user_public_profile_url(); ?>">MY PUBLIC PROFILE</a>but no luck.

It work fine on every page except when i visit other users public profile pages!! What i m doing wrong?
Could you please help me ??

« Last Edit: January 27, 2018, 12:55:22 PM by pitbull »

*

pitbull

  • ***
  • 98 posts
Re: Link to users's public profile - need Help
« Reply #1 on: January 27, 2018, 01:00:13 PM »
OK i found the solution. I had first to get the logged in user id using user helper. It was very obvious !!!