-
Author
-
March 23, 2015 at 21:31 #51263kcdripParticipant
Hello, I am building a membership site with free and paid memberships. I would like to be able to display the membership type on every profile underneath the avatar like it does on the users own profile page. Any suggestions?
March 24, 2015 at 20:23 #51391RaduModeratorHello
You can use this function
COPY CODEfunction kleo_membership_info() { global $membership_levels,$current_user; if (! $membership_levels) { return; } global $bp; $puid = $bp->displayed_user->id; //print_r (pmpro_getMembershipLevelForUser($puid)); if ($puid) { if ( pmpro_getMembershipLevelForUser($puid) ) { $membership = pmpro_getMembershipLevelForUser($puid); echo '<a href="'.pmpro_url("account").'"><span class="label radius pmpro_label">'.$membership->name.'</span></a>'; } else { echo '<a href="'.pmpro_url("levels").'"><span class="label radius pmpro_label">'.__("Upgrade account",'kleo_framework').'</span></a>'; } } } add_action('bp_before_member_header_meta', 'kleo_membership_info');
The membership level will be seen by anyone
You can customize and extend functionality of this function.
Cheers
Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solutionMarch 24, 2015 at 22:04 #51409kcdripParticipantQuestion do I add this to the functions.php in my child theme? I added and got a syntax error “Parse error: syntax error, unexpected end of file in /home3/kcdrip/public_html/wp-content/themes/kleo-child/functions.php on line 11”
March 25, 2015 at 15:27 #51469RaduModeratorPlease provide entire content of functions.php from kleo-child in a txt file.
Cheers
Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution -
AuthorPosts
Viewing 6 posts - 1 through 6 (of 6 total)
The forum ‘KLEO’ is closed to new topics and replies.