Created
April 12, 2018 18:20
-
-
Save kimcoleman/b4812e9c4e8995b70c72e3158e906871 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 hidden or 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
<?php | |
/** | |
* Add member's name and avatar to the masthead on the membership account page using the Memberlite theme. | |
*/ | |
function my_membership_account_memberlite_after_masthead_inner( ) { | |
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( 'memberlite_after_masthead_inner', 'my_membership_account_memberlite_after_masthead_inner' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment