This topic has 22 replies, 3 voices, and was last updated 10 years by sharmstr.

  • Author
  • #34985
     Kookidooki
    Participant

    Hey guys,

    Recently I’ve updated Kleo from version 1.4.2. to the latest version.

    In the older version it was able to show certain profile fields on a member’s profile header. But after updating to 2.0 it stopped working. I guess some codes have been modified during update.

    This was the working code that I used in the older Kleo version on …./members/single/member-header.php.

    COPY CODE
    <div id="member_profile">
        <div class="profile_fields"> <span style="font-size:22px; color:#222222; font-weight: normal;"><?php bp_profile_field_data( 'field=Profession' );?></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"><strong>About Me</strong><br> <span><?php bp_profile_field_data( 'field=About Me' );?></span></div><br>
    
        <div class="profile_fields"><strong>Web</strong><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');?></a></span></div><br>  
        
             <br>
    
             </div> 

    Please need help.

    #35007
     sharmstr
    Moderator

    Are you running the latest version of buddypress?

    Also, I’m assuming you had to override (copy) the memeber header page to your child theme. Whenever you override default kleo pages, you must ensure that you’re comparing them to new versions after every update. There maybe new code that wont work with the old version of the page you have in your child theme.

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    This support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com

    #35009
     sharmstr
    Moderator

    Or, maybe you made the change to the page in /kleo without copying it to /kleo-child. In which case, the update overwrote that page and you lost your code.

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    This support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com

    #35012
     Kookidooki
    Participant

    Hi sharmstr,

    I’m using the latest Buddypress.

    I don’t understand what you mean, but I only added the above mentioned code to member-header.php. No changes to style.css.

    Can you check on your side by pasting it in your member-header.php and create the custom fields “Profession”, “Location”, “About Me” and “Website”.

    #35014
     Kookidooki
    Participant

    Or what codes are you using for the custom fields in Buddypress. example of what I mean: Kleo is using this code for member profile : bp_profile_field_data. What other codes are you using for the profile fields using i.e. URL’s, checkboxes, etc.

    #35015
     sharmstr
    Moderator

    The code works fine.

    I need to know which member-header.php file you edited? The one in /kleo or one in /kleo-child? If it was in /kleo then the file was overwritten by the update and you need to re-add them.

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    This support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com

    #35016
     sharmstr
    Moderator

    Regarding codes. That’s the only code you need. Its not a kleo fucntion, its a buddypress function. Regardless of the field type that you use to set the information (checkbox, text field, dropdown) the information is stored in the database the same.

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    This support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com

    #35017
     Kookidooki
    Participant

    Okay, but can you test the code that I added on your side?

    What am I missing to show the profile fields for users. Please make it work.

    See also this:

    http://bp-tricks.com/snippets/displaying-certain-profile-fields-on-your-members-profile-page/#comments

    #35021
     sharmstr
    Moderator

    As I’ve said. It works. I tested it.

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    This support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com

    #35046
     Kookidooki
    Participant

    Hi Sharmstr,

    Sorry I’m wrong!

    This was a fresh install with the latest versions of Buddypress and Kleo; no update of Kleo!

    So of this fresh install I edited member-header.php:

    …/wp-content/themes/kleo/buddypress/members/single/member-header.php and added the snippet code. See below (I’ve copy pasted the whole member-header.php file).

    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 href="<?php bp_displayed_user_link(); ?>">
    
    		<?php bp_displayed_user_avatar( 'type=full' ); ?>
    
    	</a><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>
    <div id="member_profile">
        <div class="profile_fields"> <span style="font-size:22px; color:#222222; font-weight: normal;"><?php bp_profile_field_data( 'field=Profession' );?></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"><strong>About Me</strong><br> <span><?php bp_profile_field_data( 'field=About Me' );?></span></div><br>
        <div class="profile_fields"><strong>Web</strong><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');?></a></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' ); ?> 
    #35049
     sharmstr
    Moderator

    It works fine.

    Going forward, do NOT update core files. Those changes will be overwritten with every Kleo update. Instead, enable your child theme and move the file to /kleo-child//buddypress/members/single/member-header.php

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    This support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com

    #35052
     sharmstr
    Moderator

    Just thought of something. If this is a new install, did you actually add those fields to x-profile and have they been set in the profile you are viewing?

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    This support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com

    #35055
     Kookidooki
    Participant

    Hi Sharmstr,

    In wp-admin > Users > Profile Fields I created new Field Groups and new custom profile fields. Then I created and added the snippet code into member-header.php.

    Am I missing something? Any idea?

    #35056
     sharmstr
    Moderator

    reply privately with admin credentials and a link to your site. I’ll have a look.

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    This support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com

    #35057
     sharmstr
    Moderator

    Also, you didnt say if you actually went into a profile and set a value to those fields. If they are blank, they will not show up.

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    This support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com

    #35060
     Kookidooki
    Participant

    I tested those fields by adding some values but it didn’t showed up.. Weird!

    #35061
     sharmstr
    Moderator

    Do you have caching enabled?

    Try editing the code so it has to print something. Put something like “is this darn thing working” right after <div class=”profile_fileds”>

    COPY CODE
    
    
    <div class="profile_fields"> Testing 1, 2, 3. <span style="font-size:22px; color:#222222; font-weight: normal;">
    
    
    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    This support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com

    #35102
     giannisff
    Participant

    Sorry, do you activate the “Buddypress Xprofile Custom Fields Type” plugin?
    If yes try to deactivate it and i think it will work.
    Just an idea.

    #35104
     sharmstr
    Moderator

    That plugin isnt necessary.

    Edit: Unless he used custom fields which would be impossible to do without the plugin being activated. I tested his code without the plugin and it worked.

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    This support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com

    #35106
     giannisff
    Participant

    Εxactly, I mentioned this. With the last baddypress version there are problems with this code. The code works fine. Maybe @kookidooki not copy the file members-header.php to the child theme.

    #35109
     sharmstr
    Moderator

    Well, even if he has the child theme active, it will work if he updates the parent theme file and doesnt have a copy in his child theme. I tried to get him to send me credentials so we dont have to guess or keep going back and forth. 🙂

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    This support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com

    #35189
     Kookidooki
    Participant

    Hey guys,

    Problem solved. There was a plugin conflict. Removed the culprit and it’s working again.

    ThanX!

    #35194
     sharmstr
    Moderator

    arrrrg

    Glad you got it sorted.

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    This support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com

Viewing 23 posts - 1 through 23 (of 23 total)

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

Log in with your credentials

Forgot your details?