Direct Link to user’s profile

7.46K viewsCore
0

Is there a way to put a direct link to the user’s profile in the the WP navigation menus? I saw that user’s directory uses http://ANSPRESS_USERS_PAGE_URL to add a link. I want to give users a link to get to their profile directly, is there a similar method for that?

0

Menu view of User Profile set up in WP Menu / Anspress Page

0

I’ve created a Menu using Anspress Page.  See snapshots

1

Hi @peter and @Fred,
get the latest version from github.
I have added a new constant:

ANSPRESS_USER_PROFILE_URL

and you can directly add user profile link from menu editor.
I want to let you know that in upcoming version there will be direct link to user profiles. like: http://mydomain.com/user/rahul
and same for other permalinks:
for question: http://mydomain.com/question-title/
for list: http://mydomain.com/YOUR-BASE-PAGE

commented on answer

That’s great news! Will we be able to change/translate the “user” part of the slug? Even if not possible, this is already gonna be much better! Thanks for the hard work as usual!

Yes you can edit it from menu editor. 🙂
also I want to know how you translate ? I will suggest you to use this software : http://poedit.net/

Excellent, thank you both for this. Fred, I’m implemented your work around until the next version comes out. Thank you Rahul.

A small follow up on this one : the new constant is working great! Thanks! But every time the menu is modified, you have to input the constant again or it will be replaced by the logged in user profile link (and thus won’t change dynamically). Just have to know it but can be tricky for lots of users. 😉

Whether this feature(My profile Link) will check if the current user is logged in.Otherwise it will show the previous logged in user profile.

/user goes to the activity. /ANSPRESS_USER_PROFILE_URL doesn’t go to anything.

1

Hi @Peter!

You might be looking for a more technical answer but here is a little trick that I found. This simple url is showing the logged in user profile : http://anspress.io/questions/user/ (click to check your Open-WP profile). 😉 As long as you respect the url structure (http://mydomain.com/anspress-path/user/), it can work on any site. I use it in a conditional menu item, so that it only shows up when someone is logged in.

Pro
– super easy to implement without any technical knowledge : you just add this link in a menu item ! 😎

Con
– it is not actually redirecting to the user profile page, so the user won’t be able to get his REAL profile url (for sharing for instance)

Don’t know if it will help. For a more technical insight, try to search for “profile link” : there is already a few threads with some answers. 😉