This topic has 3 replies, 2 voices, and was last updated 11 years by SQadmin.

  • Author
  • #6314
     twoshoes
    Participant

    Hi,
    is it possible to have the membership level display on the profile page? So that everyone can see what levels the individual members are?

    #6420
     SQadmin
    Keymaster

    Add this function to sweetdate-child/functions.php

    COPY CODE
    
    function kleo_membership_info_guest()
    {
      global $membership_levels,$current_user;
      if (! $membership_levels) {
        return;
      }
      
      if (!bp_is_my_profile())
      {
    	  $membership = pmpro_getMembershipLevelForUser(bp_displayed_user_id());
        if ($membership)
        {
    		
          echo '<span class="label radius pmpro_label">'.$membership->name.'</span>';
        }
        else
        {
          echo '<span class="label radius pmpro_label">'.__("No membership",'kleo_framework').'</span>';
        }
      }
    }
    add_action('kleo_bp_after_profile_name', 'kleo_membership_info_guest');
    
    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution
    #6505
     twoshoes
    Participant

    Thank you for answering. This does however show ALL my members with the silver membership, even though they don’t have that membership. Some have the bronze, but most don’t have any membership yet. But they all show as silver now.

    #6602
     SQadmin
    Keymaster

    You are right. I have updated the code.

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution
Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.

Log in with your credentials

Forgot your details?