Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save strangerstudios/2b13686a3fbc43680ade3e01580db8cf to your computer and use it in GitHub Desktop.
Save strangerstudios/2b13686a3fbc43680ade3e01580db8cf to your computer and use it in GitHub Desktop.
Add member's name and avatar to the masthead on the membership account page using the Memberlite theme.
/*
add member's name and avatar to the masthead on the membership account page using the Memberlite theme.
*/
function my_membership_account_before_masthead_description( ) {
global $pmpro_pages, $current_user;
if(!empty($pmpro_pages) && is_page($pmpro_pages['account']))
{
echo '<div class="text-center">' . get_avatar($current_user->ID, 128) . '</div>';
echo '<h1 class="text-center">Welcome, ' . $current_user->display_name . '</h1>';
}
}
add_filter('before_masthead_description', 'my_membership_account_before_masthead_description');
@laurenhagan0306
Copy link

This recipe is included in the blog post on "Making a Powerful Member Dashboard for your Membership Account Page" at Paid Memberships Pro here: https://www.paidmembershipspro.com/making-powerful-member-dashboard-membership-account-page/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment