Button to profile page

On my welcome page I want to add a button to the users profile, how do i do this please?

In my menu I can use the CSS Class - “bp-menu bp-profile-nav” which takes users to their profile, but if I use this same CSS class in my button module (Divi theme) it just takes me to the welcome page.

So what CSS Class or URL do I use so that when someone clicks on the button it takes them to their profile, please?

Thanks

Hi Tanya,

Well, you can’t change the link with CSS… Or maybe I understood your question wrong?

In s2Member there’s a setting regarding profiles that you may want to check out: WP admin > s2Member > General Options > Member Profile Modifications

That panel includes a shortcode for your to create a profile form for your users. [s2Member-Profile /] See also: https://s2member.com/kb-article/s2member-profile-shortcode/

In our site we use it here: https://s2member.com/profile

:slight_smile:

1 Like

Hi

I didn’t say I wanted to change the link with CSS.

I don’t want a shortcode to go to a profile form I want to use a link/url in a button module (hence why a shortcode won’t work) to take someone to their profile page.

The URL in my menu that does the same is https://membership.wraca.org.uk/members/tanya/profile/

But obviously the ‘/tanya/’ bit changes depending on who’s logged in…I’m guessing the Class bp-menu bp-profile-nav that I use in the menu changes the ‘/tanya/’ part of the URL to the username of the person logged in.

So for a button module, where I need to either add in a URL to which the button will take the user or a class such as bp-menu bp-profile-nav to teh module…however when I add in the class bp-menu bp-profile-nav to the button all that happens when I click on it it goes to teh welcome page not to the profile page…

So in short I want a user to click on a button called ‘My Profile’ to take them to their profile, how can this be achieved please?

Hi Tanya,

Thanks for clarifying and the additional details.

The way we did it in our site at s2member.com, was create a single Profile page, one page for all users, but with the current user’s details, so navigation didn’t need this particular username hack.

The link with the username would need to be updated with the current user’s name, you’re right. s2 doesn’t manage the navigation. What you’re asking would need to be facilitated by the theme (some do), a plugin, or a customization…

https://wordpress.stackexchange.com/questions/196453/displaying-logged-in-user-name-in-wordpress-menu#answer-292057

https://stackoverflow.com/questions/16574545/using-variables-in-the-url-on-wordpress-menu-link

Found an old plugin for this, not sure if it still works, though. https://wordpress.org/plugins/current-username-on-navigation-lable/

I hope that helps!

:slight_smile:

I may be late to the party here, but if you are using BuddyPress (since the classes you mention I believe are BuddyPress generated classes and the url style you reference matches BuddyPress), why not try the BuddyPress generic link for member profiles in your button: http://mysite.com/members/me (updating mysite.com obviously).

Would this solve your problem, or am I misunderstanding your configuration?

~Cam

In my config I use the shortcodes @clavaque mentioned for the href url in the a link. I don’t see how CSS would matter.