WordPress.org

Support

Support » Plugins and Hacks » [Resolved] Age not formatted correctly on member directory

[Resolved] Age not formatted correctly on member directory

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author donmik

    @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 donmik

    @atallos

    You welcome! 😉

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