Support » Plugin: Buddypress Xprofile Custom Fields Type » Age on member profile inherits age from loop when outputing custom members loop.

  • Hi Donmik,

    I need to display a custom members loop above the cover image/profile photo on a members profile page, and while the custom loop shows the other members, for some reason the current “members profile” inherits the age of the first member showing up on the custom loop. Weird. If you look at the sample code below, I’m simply outputting the members loop before the profile age of the member is echoed. If you swap these and put the members loop below the code that echos the members age, it doesn’t break the age.

    Do you have any idea how I can prevent the members age from inheriting the age of the first member showing up on the custom loop code that runs before it?

    <?php if ( bp_has_members( 'type=newest&max=6' ) ) : ?>
                        <?php while ( bp_members() ) : bp_the_member(); ?>
                            <a href="<?php bp_member_permalink() ?>"><?php bp_member_avatar('type=full&width=125&height=125') ?></a>
                        <?php endwhile; ?>
    <?php endif; ?>
    
    <?php echo_age(bp_get_member_profile_data('field=Age')); ?>

    Thanks so much for your help!

    Best Regards,

    Mark

    https://wordpress.org/plugins/buddypress-xprofile-custom-fields-type/

  • The topic ‘Age on member profile inherits age from loop when outputing custom members loop.’ is closed to new replies.