User Porfile Page
-
Hi,
How do I create links for user profile?
I’d like to have these buttons on my menu: ”profile”, ”edit profile”, ”topics” etc.
But the links I see on bbpress are especific for each user, like: http://DOMAIN/forum/users/USERNAME/
Thanks.
-
????????
you can use this to add links to the edit profile section of your profile in the menu.
you can then use this to just lead to just the profile
// Filter wp_nav_menu() to profile link add_filter( 'wp_nav_menu_items', 'my_nav_menu_pro_link' ); function my_nav_menu_pro_link($menu) { if (!is_user_logged_in()) return $menu; else $current_user = wp_get_current_user(); $user=$current_user->user_login ; $profilelink = '<li><a href="/forums/users/' . $user . '/">Profile</a></li>'; $menu = $menu . $profilelink; return $menu; }
then you can just create a link to your topics archive by going to the menu section and adding a link to the menu with the link being yoursite.com/topics
Hi @Robbk,
I added this code on functions.php from my theme and appeared a link ”profile” on my menu who directs to this link: http://quadriciclobrasil.com.br/forums/users/admin/ but it is a page not found. Am I doing it correctly?
in both functions you see something similar to this
$profilelink = '<li><a href="/forums/users/' . $user . '/">Profile</a></li>';
change forums to forum , since you have changed your root slug.
$profilelink = '<li><a href="/forum/users/' . $user . '/">Profile</a></li>';
I did the changes but I am still having problems…
http://quadriciclobrasil.com.br/forum/users/admin/editDo I need to create a page or a post?
sorry to ask to much…
Do I need to create a page or a post?
no
is the edit profile link working?? is the profile link working?? both or no
link me to your profile, because it seems to be working fine based on the url
maybe edit each of the two functions , there might be a word in English that you need to change to be in your language.
Robkk,
I hope to be understanding what you are requesting from me… sorry my english…
This is my link profile (when I click on my name in any topic): http://quadriciclobrasil.com.br/forum/users/admin-2-2-2/
This is the link when I click on ”edit profile” that is appearing on my menu after have I added the code on functions.php: http://quadriciclobrasil.com.br/forum/users/admin/edit (PAGE NOT FOUND)
anyway, can I give you a admin acess?
@brunof13712 did you import your users from some other forum software/cms software ??
because how the functions work is that it uses the current users username that they use to login ,
so if you login using
username:admin
password:(the password you chosen)the functions should work fine.
but since your forum profile username is admin-2-2 it goes to a 404 not found error
Thank you so much Robkk!
I used a plugin called profile builder pro. With this plugin, the users were using their e-mail to login. Then, I removed this plugin. But all users that had made their login with their e-mail at these time had your profile url changed to something like (username)2-2-2.
Has some way so that I can adjust all the users who are with your links 2-2-2?
ask the plugin author about changing users username they used to login.
other than that i guess just allow your users to change their username they used to login for a short time.
Robkk, thank you so much!
- You must be logged in to reply to this topic.