Skip to:
Content
Pages
Categories
Search
Top
Bottom

Show empty fields in profile

  • Avatar of junithorn
    junithorn
    Participant

    @junithorn

    Hi all, as far as I can tell empty fields should be enabled when I change

    <?php if ( bp_has_profile(‘hide_empty_fields=0′) ) : ?>

    to

    <?php if ( bp_has_profile() ) : ?>

    in profile-loop.php, sadly however the empty profile fields still wont show up.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Avatar of junithorn
    junithorn
    Participant

    @junithorn

    Err, sorry I had those two reversed.

    Avatar of junithorn
    junithorn
    Participant

    @junithorn

    Just an FYI to anyone curious, here is the solution:

    <?php do_action( 'bp_before_profile_loop_content' ); ?>
    
    <?php if ( bp_has_profile('hide_empty_fields=0') ) : ?>
    
    	<?php while ( bp_profile_groups() ) : bp_the_profile_group(); ?>
    
    		<?php if ( bp_profile_group_has_fields() ) : ?>
    
    			<?php do_action( 'bp_before_profile_field_content' ); ?>
    
    			<div class="bp-widget <?php bp_the_profile_group_slug(); ?>">
    
    				<h4><?php bp_the_profile_group_name(); ?></h4>
    
    				<table class="profile-fields">
    
    					<?php while ( bp_profile_fields() ) : bp_the_profile_field('hide_empty_fields=0'); ?>
    
    						<?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 elseif ( !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>
    			</div>
    
    			<?php do_action( 'bp_after_profile_field_content' ); ?>
    
    		<?php endif; ?>
    
    	<?php endwhile; ?>
    
    	<?php do_action( 'bp_profile_field_buttons' ); ?>
    
    <?php endif; ?>
    
    <?php do_action( 'bp_after_profile_loop_content' ); ?>
    
    Avatar of dorf
    dorf
    Participant

    @dorf

    You rock for posting this! Thank you

Viewing 3 replies - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.