-
Author
-
July 22, 2017 at 16:57 #168287emilfrolundParticipant
Hi, I’d lie this text to be a static text that users can change. how do I do that?
So that people can search and the static text shows up below their names.
Love the theme, and the help – thanks!
Attachments:
You must be logged in to view attached files.July 22, 2017 at 17:23 #168290Kieran_SQModeratorHi,
With regards to adding a custom field to the profile header please try the following in your child theme’s functions.php:
COPY CODE// Add Quote to profile head add_action( 'bp_profile_header_meta', 'display_user_short_bio' ); function display_user_short_bio() { $args = array( 'field' => 'Short Bio', // Field name or ID. ); $short_bio = bp_get_profile_field_data( $args ); if ($short_bio) { echo '' . $short_bio; } }
Replace ‘Short Bio’ with the name of the field you have already created and want to display. If you want to add anything before your field is displayed please add your desired text between the ” on the echo line (example below).
COPY CODE// Add Quote to profile head add_action( 'bp_profile_header_meta', 'display_user_short_bio' ); function display_user_short_bio() { $args = array( 'field' => 'Short Bio', // Field name or ID. ); $short_bio = bp_get_profile_field_data( $args ); if ($short_bio) { echo 'Display this text before my field' . $short_bio; } }
With regards to adding this to the members directory I will have to ask my colleague @Radu to join the conversation, they’re better equipped to answer this question for you.
Thanks,
Kieran.
Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solutionIf you like the theme or the support you've received please consider leaving us a review on Themeforest!
Custom development requests can be sent to dev@seventhqueen.com, one of the development team will be happy to discuss your needs.
July 22, 2017 at 22:08 #168316emilfrolundParticipantHi, this worked very well – but now it shows both of the texts; not just my “short bio”
July 22, 2017 at 22:40 #168318Kieran_SQModeratorHi,
If you want to remove the latest update text too you’ll have to use the KLEO child theme and copy and edit a file.
Copy the below file from KLEO theme folder
/kleo/buddypress/members/single/member-header.php
To the child theme folder
/kleo-child/buddypress/members/single/member-header.php
If you do not already have these folders created in your child theme you will need to do so.
Once you have your folders made and the member-header.php file copied you can remove line 57 from the copy within your child theme, it should look like the following:
<?php bp_activity_latest_update( bp_displayed_user_id() ); ?>
Likewise if you wish to remove the latest update from the members page then please copy the below file into your child theme using the instructions from above
/kleo/buddypress/members/members-loop.php
Once copied to your child theme you can remove lines 72-74.
Kieran.
Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solutionIf you like the theme or the support you've received please consider leaving us a review on Themeforest!
Custom development requests can be sent to dev@seventhqueen.com, one of the development team will be happy to discuss your needs.
July 22, 2017 at 23:28 #168326emilfrolundParticipanti have removed the line – i’m quite sure i have done it correctly.
Attachments:
You must be logged in to view attached files.July 22, 2017 at 23:30 #168330emilfrolundParticipantit doesnt work. i have removed cache and refreshed.
July 22, 2017 at 23:33 #168331Kieran_SQModeratorHi,
Please update this ticket with some admin credentials so I can look further into this.
Thanks,
Kieran.
Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solutionIf you like the theme or the support you've received please consider leaving us a review on Themeforest!
Custom development requests can be sent to dev@seventhqueen.com, one of the development team will be happy to discuss your needs.
July 24, 2017 at 19:36 #168482RaduModeratorHi,
Provide also the FTP credentials to can take a closer look at the files
Cheers
R.Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solutionJuly 26, 2017 at 18:38 #168669RaduModeratorHi,
Done, all good now,
I’ve wrapped the about text into this div class if you need to adjust style : .myshortbio
If you need to style only the .myshortbio div class just add the directory before it.
Example for styling the about text only on directory
COPY CODE.directory .myshortbio { color:red; }
Example for styling the about text only on members profile
COPY CODE.profile .myshortbio { color:red; }
The final php code looks like this
COPY CODE// Add Quote to profile head and also to the members directory ( edited on 26 JUL 2017 @ SQ['Radu'] ) add_action( 'bp_profile_header_meta', 'display_user_short_bio' ); add_action( 'bp_directory_members_item', 'display_user_short_bio' ); function display_user_short_bio() { $short_bio = xprofile_get_field_data( 'About', bp_get_member_user_id(), $multi_format = 'comma' ); if ($short_bio) { echo '<div class="myshortbio">' . $short_bio . '</div>'; } }
Cheers
R.Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solutionJuly 26, 2017 at 22:25 #168696emilfrolundParticipantShould I add this to the functions.php folder in the KLEO child theme?
By the way – amazing support, this is great.
July 28, 2017 at 00:54 #168791RaduModeratorHi,
It’s already added I’ve told you what I’ve done to achieve that.
the about me field it’s shown in the directory http://cabortv.com/members/ and also on the profile.
If you are happy with our customer support leave us a review and 5* on ThemeForest page, please.
Cheers
R.Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solutionJuly 31, 2017 at 16:12 #169116RaduModeratorYou’re welcome
Have a nice week
Cheers
R.Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution -
AuthorPosts
You must be logged in to reply to this topic.