This topic has 5 replies, 3 voices, and was last updated 7 years by Radu.

  • Author
  • #156076
     Proton
    Participant

    Hi

    All i want to do is for membership level to be displayed in the public buddypress profile. For example, Level:Gold, Level:Silver, Bronce etc.

    Is there a function that will do this?

    Thanks

    #156077
     Proton
    Participant

    this may help for context

    Attachments:
    You must be logged in to view attached files.
    #156201
     Laura
    Moderator

    Hello, will assign the ticket to a higher support level who can help and advise you in your query.
    Thanks! ?

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    Laura Solanes - Graphic Designer and Web Designer

    Please be patient as I try to answer each topic as fast as i can.

    If you like the theme or the support you've received please consider leaving us a review on Themeforest!

    Always happy to help you 🙂

    #156233
     Radu
    Moderator

    Hi,

    See screenshot

    The membership role cannot be rendered in the fields area there is no hook available.

    COPY CODE
    
    
    function render_membership_level_on_profile() {
    
        if(is_user_logged_in() && function_exists('pmpro_hasMembershipLevel') && pmpro_hasMembershipLevel())
        {
            global $current_user;
            $current_user->membership_level = pmpro_getMembershipLevelForUser($current_user->ID);
            echo '<div class="mem-level-user-profile">Membership Level: ' . $current_user->membership_level->name .'</div>';
        }
    
    }
    
    add_action('kleo_bp_after_profile_image','render_membership_level_on_profile');
    

    The function needs to be pasted in wp-content/themes/sweetdate-child/functions.php

    Cheers
    R.

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution
    #156236
     Proton
    Participant

    Hi Radu

    Thanks for the reply but it doesn’t quite do what i require. What it currently does is displays the logged in users membership on every profile that the logged in user visits.

    What i’d like to do is for the membership of each member, to be displayed on that members profile. For example say there are three members, Paul, Peter, John. If Paul buys Gold, it must display on Paul’s profile: Gold Membership. And if Peter buys Bronze, it must state on Peters profile: Bronze.

    Can you help me with that?

    Thanks!

    #156239
     Radu
    Moderator

    Hi,
    This cannot be achieved without custom development so I cannot help you to achieve that since this is not a theme problem, you can achieve this by hiring a web developer

    Cheers
    R.

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

You must be logged in to reply to this topic.

Log in with your credentials

Forgot your details?