Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.