How to customize the order of fields of registration
@rcjr24 you can change the order within Users > Profile Fields panel
https://codex.buddypress.org/buddypress-components-and-features/extended-profiles/
@mercime I manage to rearrange all the fields using the code I posted, and now I have a code like this,
<?php if ( function_exists( 'bp_has_profile' ) ) : if ( bp_has_profile( 'profile_group_id=1&hide_empty_fields=0' ) ) : while ( bp_profile_groups() ) : bp_the_profile_group(); ?>
<?php while ( bp_profile_fields() ) : bp_the_profile_field(); ?>
<?php if ( 'Country of Residence' == bp_get_the_profile_field_name() ) : ?>
<select class="country-residence" name="<?php bp_the_profile_field_input_name(); ?>" id="<?php bp_the_profile_field_input_name(); ?>" placeholder="<?php _e( bp_the_profile_field_name().':' ); ?>">
<?php //bp_the_profile_field_options();
global $wpdb;
$sql = "SELECT * FROM wp_country_list";
$results = $wpdb->get_results($sql) or die(mysql_error());
echo '<option data-value="holder-only" class="holder">Country of Residence:</option>';
foreach( $results as $result ) {
echo '<option data-value="'. $result->three_letter_code .'" value="'. $result->three_letter_code .'">'.$result->name.'</option>';
}
?>
</select>
<?php do_action( bp_get_the_profile_field_errors_action() ); ?>
<?php endif; ?>
<?php endwhile; ?>
<?php endwhile; endif; endif; ?>
Now the problem is, when the registration completes, this field doesn’t reflect to the user profile after successful registration. Hope you’ve got my point here.