I am using the plugin Sidebar Login for BuddyPress which enables users to insert a login box in the sidebar which in turn produces three links: Dashboard, Profile, and Logout.
My issue is that the Profile link, links to the WordPress dashboard. I would like it to link to the actual BuddyPress profile page. Is there any way I can change something in sidebar-login.php
or admin.php
to remedy this problem?
I have pasted sidebar-login.php
here: http://pastebin.com/V2v1t4gm
I have pasted admin.php
here: http://pastebin.com/6KjxeZ3h
There are two ways to do that:
From the plugin settings page
On the “Loggedin Links” option, the second anchor tag is pointing to WordPress profile by default:
'<a href="http://yoursite.com/wp-admin/profile.php">Profile</a>'
. You have to update this to point to Buddypress profile page, to do so, you need to know what is the members domain that Buddypress is using, by default it will behttp://yoursite.com/members/username/
, but it can be different if you have chosen another page to display the members directory from Buddypress settingsSettings -> Buddypress -> Pages
. To be sure just visit your profile and copy the browser URL, and then paste it in thehref
attribute of the Profile anchor tag, and then replace your username with%USERNAME%
so that the anchor will become:Just edit this according to your settings.
Edit the plugin file (not recommended)
If you wish to edit the plugin file to dynamically get the user profile page link, add the following line of code after line 96 (just before echo the logout link) on
sidebar-login.php
:Make sure to remove the Profile link from the Loggedin Links field of the settings page of the plugin so that you wont have double profile links on your widget. This way is not recommended because you will loose your modifications on plugin update and you will have to re-edit the file on each update of the plugin.