I installed and got wp-members to work the way I want on http://free.cloudvas.net (back engine not fully working yet but the wordpress front seems to be working just fine).
When a user logs in I would like to display a link to the members area so the users can change their info/password if they like.
I would like to display the link to the members are below the “You are logged in as xyz“.
I have created the members are site already by adding
[wp-members page="members-area"]to the content area of one of my pages.
Any ideas how I could accomplish this?
Thanks a bunch
Hey there. I’m not sure if we’re on the same page, but if we are, you would want to add this line of code on or about line 151 in the wp-members-sidebar.php file where it says global $user_login.
$page = $url . ‘/my-profile’;
just a couple lines down I put this code right under where it displays the current layout for logging out.
<link html here=”‘ . $logout . ‘”>’ . __( ‘Logout’, ‘wp-members’ ) . ‘ | <link html here=”‘ . $page . ‘”>’ . __( ‘Profile’, ‘members-area’ ) . ‘</p>’;
where it says “<link html here=” replace that with “<a href=”
Hope this helps.
p.s. on the first code i gave, the ‘/my-profile’ that should be the path/page your members area is located so they can change their passwords etc.
Thank you 1-jah. That worked, with a little tweaking.
For me (maybe I have a newer version), it was around line 300.
My new lines look like:
$page = $url . '/user-profile';
<a href="' . $logout . '">' . __( 'Logout', 'wp-members' ) . '</a> | ' . '<a href="' . $page . '">' . __( 'Profile', 'user-profile' ) . '</a></p>';
I also figured out a way to do this with a text widget and CSS styling, so no changes to code needed.
I added a text widget after the wp-members widget and put this in the text widget:
[wp-members status="in"] <a href="http://mysite.com/user-profile/">Edit my profile</a> [/wp-members]
Then I styled it to remove the bottom margin and padding of the wp-members widget and reduce the top padding of the text widget. Now the 2 widgets are joined together and appear to be one.
When not logged in to the site, the ‘Edit my profile’ of course does not show, but you do see a little extra white space from the empty text widget.
Hmmmm….mind pasting your wp-member-sidebar.php file here so I can see? Your site is not very mobile friendly and I’m on my iPad right now. And I suggest removing your text widget.
Tony – it would be better to make a customization like that using a filter function. In this case, I think wpmem_sidebar_status would what you would want to use (see: http://rocketgeek.com/plugins/wp-members/users-guide/filter-hooks/wpmem_sidebar_status/). You should never change the plugin’s code directly as your changes are going to be overwritten if you upgrade. And if you don’t upgrade you are going to miss out on not only new features, but also potential security updates.
- The topic ‘Members area link in menu’ is closed to new replies.