Dividing xprofile fields into groups in the profile-loop ?
-
Hi everyone,
I’m trying to modify the profile-loop in such a way that I can call for certain groups and display them under different tabs.
I want to have 3 tabs; Basic, Personal and Medical which shows the xprofile fields from those 3 categories. In the admin panel you can already create those groups, but how can I display them nicely on a profile seperated by tabs?
A screenshot from what I have right now:
http://www.bp-tricks.com/wp-content/uploads/tabs_profile.png
So the question: how can I fill the other tabs with the content from the different profile groups?
btw my current (modified) profile loop looks like this:
<?php if ( function_exists('xprofile_get_profile') ) : ?>
<?php if ( bp_has_profile() ) : ?>
<?php while ( bp_profile_groups() ) : bp_the_profile_group(); ?>
<?php if ( bp_profile_group_has_fields() ) : ?>
<?php do_action( 'bp_before_profile_field_content' ) ?>
<table class="profile-fields">
<?php while ( bp_profile_fields() ) : bp_the_profile_field(); ?>
<?php if ( bp_field_has_data() ) : ?>
<tr<?php bp_field_css_class() ?>>
<td class="label">
<?php bp_the_profile_field_name() ?>
</td>
<td class="data">
<?php bp_the_profile_field_value() ?>
</td>
</tr>
<?php endif; ?>
<?php do_action( 'bp_profile_field_item' ) ?>
<?php endwhile; ?>
</table>
<?php do_action( 'bp_after_profile_field_content' ) ?>
<?php endif; ?>
<?php endwhile; ?>
<?php do_action( 'bp_profile_field_buttons' ) ?>
<?php else: ?>
<p><?php _e( 'Sorry, this person does not have a public profile.', 'buddypress' ) ?></p>
<?php endif;?>
<?php else : ?>
<?php bp_core_get_wp_profile() ?>
<?php endif; ?>
- The topic ‘Dividing xprofile fields into groups in the profile-loop ?’ is closed to new replies.