Last active
April 13, 2021 04:21
-
-
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.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
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'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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/