Skip to:
Content
Pages
Categories
Search
Top
Bottom

Display image for paid members

  • @gurusurfer

    Participant

    Hi,

    I am trying to display an icon for paid members on their profile next to their avatar.

    Now i am using this conditional tag from membership pro:

    <?php if ( ms_has_membership() ) : ?>
    </img>
    <?php endif; ?>

    Also tried:

    <?php
    if ( ms_has_membership() ) {
    echo ‘‘;
    } else {
    echo ‘‘;
    }
    ?>

    Only the image in false is being returned for all users including paid members.

    Any advice is much appreciated.

    Thanks

Viewing 4 replies - 1 through 4 (of 4 total)
  • @gurusurfer

    Participant

    Hi,

    Sorry, here is the code again!

    <?php if ( ms_has_membership() ) : ?>
    <img src="http://my-site.com/wp-content/uploads/2015/11/img.png" alt="" height="25" width="25" /></img>
    <?php endif; ?>

    Also tried:

    <?php 
    if ( ms_has_membership() ) {
    echo '<img src="http://my-site.com/wp-content/uploads/2015/11/img.png" alt="" height="25" width="25" />';
    } else {
    echo '<img src="http://my-site.com/wp-content/uploads/2015/11/img2.png" alt="" height="25" width="25" />';
    }
    ?>

    Only the image in false is being returned for all users including paid members.

    Any advice is much appreciated.

    Thanks

    @shanebp

    Moderator

    Only the image in false is being returned for all users including paid members.

    Then ms_has_membership() is returning false.
    Are you sure you’re using it correctly?
    Maybe you need to pass a user_id?
    if so, try ms_has_membership( bp_displayed_user_id() )
    As it is a custom function, we have no idea how it is written.

    @gurusurfer

    Participant

    Thanks for the amazing support!

    Yes, I am sure it should return true as we have a lot of paid memberships!

    And I think i am using is properly, here is the codex on it http://cbcd.org/wp-content/plugins/membership/docs/namespaces/default.html

    @gurusurfer

    Participant

    Just so to be clear since you mentioned the class!

    I am not trying to show the image for paid members visitors here. I want to add an image for the member profile for any user to see when they land on their profile page.

    If you are not familiar with the above tag, do you have a suggestion how I can display an image icon for user profiles of custom role?

    Many thanks

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Display image for paid members’ is closed to new replies.
Skip to toolbar