Support » Plugin: Buddypress Xprofile Custom Fields Type » Age not formatted correctly on member directory

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Miguel L贸pez

    (@atallos)

    Hi,

    You need to create a function to calculate your age you can use my plugin for example. Put this code in the functions.php in your theme:

    function echo_age($birthdate) {
        echo floor((time() - strtotime($birthdate))/31556926);
    }

    Now instead of using this
    <?php bp_member_profile_data( 'field=Age' );?>

    Use this:
    `<?php echo_age(bp_get_member_profile_data(‘field=Age’)); ?>

    And it will work I think.

    Hi!
    It’s not working perfectly!
    Thank you so much for your help! 馃槈

    Thousand thanks for this tip Atallos, and for your very very useful plugin!

    Plugin Author Miguel L贸pez

    (@atallos)

    You welcome! 馃槈

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Age not formatted correctly on member directory’ is closed to new replies.