This topic has 2 replies, 2 voices, and was last updated 9 years by Radu.

  • Author
  • #44248
     Kookidooki
    Participant

    Hey guys,

    I would like to display some profile fields in the head of a member’s profile page just below the avatar.
    For example. I’ve created some extended profile fields:
    Hobbies, location and website -url.

    In /wp-content/themes/kleo/buddypress/members/single/member-header.php I’ve added these codes below….., however I’ve noticed that under the “Profile”-tab it’s displaying all those profile fields doubled.

    What’s wrong with this code? Have I overlooked / missing something?


    <?php

    /**
    * BuddyPress - Users Header
    *
    * @package BuddyPress
    * @subpackage bp-legacy
    */

    ?>

    <?php do_action( 'bp_before_member_header' ); ?>

    <div id="item-header-avatar" class="rounded">
    ">

    <?php bp_displayed_user_avatar( 'type=full' ); ?>

    <br>
    <?php do_action('bp_member_online_status', bp_displayed_user_id()); ?>
    </div><!-- #item-header-avatar -->

    <div id="item-header-content" <?php if (isset($_COOKIE['bp-profile-header']) && $_COOKIE['bp-profile-header'] == 'small') {echo 'style="display:none;"';} ?>>

    <?php if ( bp_is_active( 'activity' ) && bp_activity_do_mentions() ) : ?>

    <?php endif; ?>

    <span class="activity"><?php bp_last_activity( bp_displayed_user_id() ); ?></span><br>

    </div>
    <div id="member_profile">
    <div class="profile_fields"> <span style="font-size:22px; color:#222222; font-weight: normal;"><?php bp_profile_field_data( 'field=Hobbies' );?></span> | <span style="font-size:22px; color:#222222; font-weight: normal;"><?php bp_profile_field_data( 'field=Location' );?></span></div><br><br>

    <div class="profile_fields">Web<br> <span style="font-size:14px; color:#00bcf2; font-weight: normal;"><a href="<?php
    bp_profile_field_data( 'field=Website' );?>"Website:
    <span style="color:#0067b4;"><?php bp_profile_field_data( 'field=Website');?></span></div><br>

    <br>

    </div>
    <?php do_action( 'bp_before_member_header_meta' ); ?>

    <div id="item-meta">

    <div id="item-buttons">

    <?php do_action( 'bp_member_header_actions' ); ?>

    </div><!-- #item-buttons -->

    <?php

    do_action( 'bp_profile_header_meta' );

    ?>

    </div><!-- #item-meta -->

    </div><!-- #item-header-content -->

    <?php do_action( 'bp_after_member_header' ); ?>

    <?php do_action( 'template_notices' ); ?>

    #44249
     Kookidooki
    Participant

    <?php

    /**
    * BuddyPress – Users Header
    *
    * @package BuddyPress
    * @subpackage bp-legacy
    */

    ?>

    <?php do_action( ‘bp_before_member_header’ ); ?>

    <div id=”item-header-avatar” class=”rounded”>
    “>

    <?php bp_displayed_user_avatar( ‘type=full’ ); ?>

    <br>
    <?php do_action(‘bp_member_online_status’, bp_displayed_user_id()); ?>
    </div><!– #item-header-avatar –>

    <div id=”item-header-content” <?php if (isset($_COOKIE[‘bp-profile-header’]) && $_COOKIE[‘bp-profile-header’] == ‘small’) {echo ‘style=”display:none;”‘;} ?>>

    <?php if ( bp_is_active( ‘activity’ ) && bp_activity_do_mentions() ) : ?>

    <?php endif; ?>

    <span class=”activity”><?php bp_last_activity( bp_displayed_user_id() ); ?></span><br>

    </div>
    <div id=”member_profile”>
    <div class=”profile_fields”> <span style=”font-size:22px; color:#222222; font-weight: normal;”><?php bp_profile_field_data( ‘field=Hobbies’ );?></span> | <span style=”font-size:22px; color:#222222; font-weight: normal;”><?php bp_profile_field_data( ‘field=Location’ );?></span></div><br><br>

    <div class=”profile_fields”>Web<br> <span style=”font-size:14px; color:#00bcf2; font-weight: normal;”><a href=”<?php
    bp_profile_field_data( ‘field=Website’ );?>”Website:
    <span style=”color:#0067b4;”><?php bp_profile_field_data( ‘field=Website’);?></span></div><br>

    <br>

    </div>
    <?php do_action( ‘bp_before_member_header_meta’ ); ?>

    <div id=”item-meta”>

    <div id=”item-buttons”>

    <?php do_action( ‘bp_member_header_actions’ ); ?>

    </div><!– #item-buttons –>

    <?php
    /***
    * If you’d like to show specific profile fields here use:
    * bp_member_profile_data( ‘field=About Me’ ); — Pass the name of the field
    */
    do_action( ‘bp_profile_header_meta’ );

    ?>

    </div><!– #item-meta –>

    </div><!– #item-header-content –>

    <?php do_action( ‘bp_after_member_header’ ); ?>

    <?php do_action( ‘template_notices’ ); ?>

    #44387
     Radu
    Moderator

    On my side works correctly not duplicated fields.

    COPY CODE
    
    <?php
    
    /**
     * BuddyPress - Users Header
     *
     * @package BuddyPress
     * @subpackage bp-legacy
     */
    
    ?>
    
    <?php do_action( 'bp_before_member_header' ); ?>
    
    <div id="item-header-avatar" class="rounded">
    	<a>">
    
    		<?php bp_displayed_user_avatar( 'type=full' ); ?>
    
    	</a>
      <?php do_action('bp_member_online_status', bp_displayed_user_id()); ?>
    </div><!-- #item-header-avatar -->
    
    <div id="item-header-content" <?php if (isset($_COOKIE['bp-profile-header']) && $_COOKIE['bp-profile-header'] == 'small') {echo 'style="display:none;"';} ?>>
    
    	<?php if ( bp_is_active( 'activity' ) && bp_activity_do_mentions() ) : ?>
    		<h4 class="user-nicename">@<?php bp_displayed_user_mentionname(); ?></h4>
    	<?php endif; ?>
    
    	<span class="activity"><?php bp_last_activity( bp_displayed_user_id() ); ?></span>
    
    	<?php do_action( 'bp_before_member_header_meta' ); ?>
    
    	<div id="item-meta">
    
    		<?php if ( bp_is_active( 'activity' ) ) : ?>
    
    			<div id="latest-update">
    
    				<?php bp_activity_latest_update( bp_displayed_user_id() ); ?>
    
    			</div>
    
    		<?php endif; ?>
    
    		<div id="item-buttons">
    
    			<?php do_action( 'bp_member_header_actions' ); ?>
    
    		</div><!-- #item-buttons -->
    <div class="profile_fields">
    	<span style="font-size:22px; color:#222222; font-weight: normal;">
    	<?php bp_profile_field_data( 'field=Hobbies' );?></span> |
    	<span style="font-size:22px; color:#222222; font-weight: normal;">
    	<?php bp_profile_field_data( 'field=Location' );?></span>
    </div>
    <br>
    <div class="profile_fields">Web<br>
    <span style="font-size:14px; color:#00bcf2; font-weight: normal;"><a href="<?php
    bp_profile_field_data( 'field=Website' );?>"><?php bp_profile_field_data( 'field=Website');?></span></div><br>
    
    		<?php
    		/***
    		 * If you'd like to show specific profile fields here use:
    		 * bp_member_profile_data( 'field=About Me' ); -- Pass the name of the field
    		 */
    		 do_action( 'bp_profile_header_meta' );
    
    		 ?>
    
    	</div><!-- #item-meta -->
    
    </div><!-- #item-header-content -->
    
    <?php do_action( 'bp_after_member_header' ); ?>
    
    <?php do_action( 'template_notices' ); ?>
    
    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution
Viewing 3 posts - 1 through 3 (of 3 total)

The forum ‘General questions’ is closed to new topics and replies.

Log in with your credentials

Forgot your details?