BuddyDev

Search

[Resolved] Xprofile show age in "members-loop"

  • Participant
    Level: Initiated
    Posts: 19
    theodor Snarum on #16203

    Hi,
    I am trying to get the “age” not the birthday to show in “members-loop” and in my theme “cover-image-heaer” but for now all it show is the birthday.

    Tried searching around and can not found a way

    ;bp_member_profile_data( 'field=Age' );

    and

               $Age = bp_get_member_profile_data( 'field=Age' );
    echo $Age; 

    Thanks for all the help

  • Keymaster
    (BuddyDev Team)
    Posts: 24190
    Brajesh Singh on #16204

    Hi Theodor,
    Welcome to BuddyDev.

    Please visit Dashboard->Users->profile Fields and click on Edit For the “Age” field.

    On edit page, you will see the settings. There is a setting like this

    
    Check this if you want to show age instead of birthdate:
    

    Please uncheck it and save. Now, the field will show date.

    Regards
    Brajesh

  • Participant
    Level: Initiated
    Posts: 19
    theodor Snarum on #16211

    Hi,
    On the profile it shows “Age” BirthDate field – as XX Years, correctly, i am trying to show the “Age” Birthdatefield as xx years, in the members-looop.php file to as using the bp_member_profile_data( ‘field=Age’ ); but this then show the birthdate not the xx years.

    is it a way to change this

    Theo

  • Keymaster
    (BuddyDev Team)
    Posts: 24190
    Brajesh Singh on #16213

    Hi Theo,
    Thank you for clarification. I had assumed the opposite.

    Please allow me to check. I don’t see any reason. The only possibility if display_filter is not called, this might happen.

    I will update you later today.

    Regards
    Brajesh

  • Participant
    Level: Initiated
    Posts: 19
    theodor Snarum on #16478
    This reply has been marked as private.
  • Keymaster
    (BuddyDev Team)
    Posts: 24190
    Brajesh Singh on #16482

    Hi Theo,
    I am sorry I could not reply earlier.

    Please use this

    
     <?php  echo xprofile_get_field_data( "Age", bp_get_member_user_id() );?>
    
    

    For members loop. The problem with it does not seem to be applying the display filter.

    Using xprofile_get_field_data works.

    Regards
    Brajesh

  • Participant
    Level: Initiated
    Posts: 19
    theodor Snarum on #16493

    Perfect
    that saved my day

    theo

  • Keymaster
    (BuddyDev Team)
    Posts: 24190
    Brajesh Singh on #16500

    You are welcome.

You must be logged in to reply to this topic.

This topic is: resolved