• I am having an issue with the birth date displaying the age instead of the actual birth date in my members directory.

    The profile field displays the age in the members profile page but, in the directory it is displaying the whole birth date.

    I have the members information displaying in the members directory via this code:
    /**
    * Sweetdate Child Theme Functions
    * Add extra code or replace existing functions
    */
    //members page fields
    add_action(‘after_setup_theme’,’kleo_my_member_data’);
    function kleo_my_member_data()
    {
    global $kleo_config;
    //this is the details field, right now it take the “About me” field content
    $kleo_config[‘bp_members_details_field’] = ‘About me’;
    //this display the fields under the name, eq: 36 / Woman / Divorced / Berlin. Modify with the names of the fields you want to appear there
    $kleo_config[‘bp_members_loop_meta’] = array(
    ‘Member Type’,
    ‘His Age’,
    ‘His Sexuality’,
    ‘Her Age’,
    ‘Her Sexuality’,
    ‘Marital status’,
    );
    }
    ?>

    How do I get this to display the age and not the actual field data?

    Thanks!
    Michele

Viewing 3 replies - 1 through 3 (of 3 total)
  • metalhead

    (@aaronthomas1979)

    I think you’re talking about the members-loop.php, right? Your “Member List?”

    To display actual age instead of date of birth in members-loop, use this:

    echo xprofile_get_field_data('Date of Birth', bp_get_member_user_id());

    Date of Birth is the name of my field, so just replace that with yours.

    • This reply was modified 7 years, 11 months ago by metalhead.
    lighterdayz

    (@lighterdayzyahoocom)

    Thanks metalhead! You rock! ??

    • This reply was modified 7 years, 9 months ago by lighterdayz.

    Its show DOB, like below. Not an age,
    March 9, 1998

    Is any way to change the format of date or get exact age of user.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Birthdate not age showing in members-loop’ is closed to new replies.