Skip to:
Content
Pages
Categories
Search
Top
Bottom

Add profile info to the group page within the bp_group_the_member loop

  • @jarvo1980

    Member

    Hi All,

    Total noob so apologies if this is a daft question. When you click into groups and then view the members, I’d like to show more than the avatar and name. I’ve setup a new custom field called nickname. How can I show that in the loop? I tried:
    `
    <?php
    $Nickname= xprofile_get_field_data( Nickname,bp_get_member_user_id());
    echo $Nickname;
    ?>
    `
    But to no avail. Any help is very much appreciated!

    TIA

    Edit // backticks added for code view -hnla

Viewing 11 replies - 1 through 11 (of 11 total)
  • @anonymized-96400

    Inactive

    You need to put code into backticks “.

    @jarvo1980

    Member

    Ooops sorry “ AND “
    Both to no avail..

    Oddly, this does work for one of my other custom fields though:
    `<?php
    $account_type= xprofile_get_field_data( ‘Account Type’,bp_get_member_user_id());
    if ($account_type== ‘Standard’) {
    echo ‘standard’;
    } else {
    echo ‘premium’;
    };
    ?>`
    Most confusing!!

    @anonymized-96400

    Inactive

    Try ‘Nickname’ instead of just Nickname

    Edit: oops, just saw that you tried that already…

    @jarvo1980

    Member

    Thanks Travel-Junkie. Yeah it’s odd, as it works for account type. I thought maybe it was the way I was echoing out the info. Hmmm…

    @anonymized-96400

    Inactive

    Have you tried passing in the user_id as a second argument?

    @jarvo1980

    Member

    I tried “
    Is that what you meant? Otherwise not sure as it’s on the main loop page (groups/single/members.php)
    Thanks

    @anonymized-96400

    Inactive

    Yep, but you need to wrap Nickname with ‘, so that’d be ‘Nickname’

    @jarvo1980

    Member

    Sadly “ is a no go either. :-(

    @anonymized-96400

    Inactive

    Does that field actually exist? :)

    @jarvo1980

    Member

    Yes, I’ve even tried with a couple of others. It’s so frustrating! And yes, it does also have text in the field ;-)

    @jarvo1980

    Member

    For arguments sake, I’ve deleted the Nickname one and tried with another. Here’s my code incase I’m being a complete thicko
    `

    • <a href="”>

      <!


      >

      <?php
      $account_type= xprofile_get_field_data( ‘Account Type’,bp_get_member_user_id());
      if ($account_type== ‘Standard’) {
      echo ‘standard’;
      } else {
      echo ‘premium’;
      };
      ?>

      <?php $Street= xprofile_get_field_data( "Street");
      echo $Street;
      ?>

      <!


      >

       

    `

    The only thing that displays on the custom field front is the account_type of either Standard or Premium.

Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘Add profile info to the group page within the bp_group_the_member loop’ is closed to new replies.
Skip to toolbar