-
Author
Tagged: fields profile header
-
November 11, 2014 at 10:27 #34985KookidookiParticipant
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.
November 11, 2014 at 14:15 #35007sharmstrModeratorAre 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 solutionThis support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com
November 11, 2014 at 14:17 #35009sharmstrModeratorOr, 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 solutionThis support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com
November 11, 2014 at 14:40 #35012KookidookiParticipantHi 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”.
November 11, 2014 at 14:54 #35014KookidookiParticipantOr 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.
November 11, 2014 at 14:54 #35015sharmstrModeratorThe 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 solutionThis support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com
November 11, 2014 at 14:56 #35016sharmstrModeratorRegarding 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 solutionThis support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com
November 11, 2014 at 14:59 #35017KookidookiParticipantOkay, 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:
November 11, 2014 at 15:11 #35021sharmstrModeratorAs 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 solutionThis support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com
November 11, 2014 at 16:49 #35046KookidookiParticipantHi 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' ); ?>
November 11, 2014 at 17:10 #35049sharmstrModeratorIt 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 solutionThis support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com
November 11, 2014 at 17:12 #35052sharmstrModeratorJust 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 solutionThis support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com
November 11, 2014 at 17:41 #35055KookidookiParticipantHi 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?
November 11, 2014 at 17:45 #35056sharmstrModeratorreply 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 solutionThis support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com
November 11, 2014 at 17:46 #35057sharmstrModeratorAlso, 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 solutionThis support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com
November 11, 2014 at 18:19 #35060KookidookiParticipantI tested those fields by adding some values but it didn’t showed up.. Weird!
November 11, 2014 at 18:25 #35061sharmstrModeratorDo 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 solutionThis support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com
November 11, 2014 at 22:37 #35102giannisffParticipantSorry, 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.November 11, 2014 at 22:42 #35104sharmstrModeratorThat 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 solutionThis support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com
November 11, 2014 at 22:49 #35106giannisffParticipantΕ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.
November 11, 2014 at 23:02 #35109sharmstrModeratorWell, 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 solutionThis support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com
November 12, 2014 at 14:36 #35189KookidookiParticipantHey guys,
Problem solved. There was a plugin conflict. Removed the culprit and it’s working again.
ThanX!
November 12, 2014 at 14:50 #35194sharmstrModeratorarrrrg
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 solutionThis support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com
-
AuthorPosts
The forum ‘General questions’ is closed to new topics and replies.