xprofile fields displaying data from another user
I’ve added an extended profile using xprofile fields, and I’m displaying some of the fields on the members list page. But, if someone has left a field blank, their profile is displaying the data for the last member who did complete that field. (So, if I didn’t put my city but the person displayed before me did, that person’s city is showing in my profile.) You can see what I mean here: http://yarngroup.wpengine.com/members/
I copied members-loop.php to a buddypress folder in my main theme folder, and here’s the code I added to display the name, city and state:
<?php /** * Fires inside the display of a directory member item. * * @since 1.1.0 */ do_action( 'bp_directory_members_item' ); ?> <?php /*** * If you want to show specific profile fields here you can, * but it'll add an extra query for each member in the loop * (only one regardless of the number of fields you show): * *bp_member_profile_data( 'field=the field name' ); */ bp_member_profile_data( 'field=Your Name' ); echo '<br />'; bp_member_profile_data( 'field=City' ); echo ', '; bp_member_profile_data( 'field=State' ); echo '<br />'; ?> <a href="<?php bp_member_permalink(); ?>">View Member Profile</a> <div class="action"> <?php /** * Fires inside the members action HTML markup to display actions. * * @since 1.1.0 */ do_action( 'bp_directory_members_actions' ); ?> </div> </li> <?php endwhile; ?> </ul> <div class="clear"></div>
Am I missing some code? Thanks!
- You must be logged in to reply to this topic.