Skip to:
Content
Pages
Categories
Search
Top
Bottom

Add profile info to the group page within the bp_group_the_member loop

  • 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)

  • Boris
    Participant

    @travel-junkie

    You need to put code into backticks “.

    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!!


    Boris
    Participant

    @travel-junkie

    Try ‘Nickname’ instead of just Nickname

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

    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…


    Boris
    Participant

    @travel-junkie

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

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


    Boris
    Participant

    @travel-junkie

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

    Sadly “ is a no go either. :-(


    Boris
    Participant

    @travel-junkie

    Does that field actually exist? :)

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

    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