This topic has 15 replies, 3 voices, and was last updated 7 years by Radu.

  • Author
  • #168287
     emilfrolund
    Participant

    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.
    #168290
     Kieran_SQ
    Moderator

    Hi,

    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 solution

    If 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.

    #168316
     emilfrolund
    Participant

    Hi, this worked very well – but now it shows both of the texts; not just my “short bio”

    #168318
     Kieran_SQ
    Moderator

    Hi,

    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 solution

    If 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.

    #168326
     emilfrolund
    Participant

    i have removed the line – i’m quite sure i have done it correctly.

    Attachments:
    You must be logged in to view attached files.
    #168330
     emilfrolund
    Participant

    it doesnt work. i have removed cache and refreshed.

    #168331
     Kieran_SQ
    Moderator

    Hi,

    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 solution

    If 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.

    #168335
     emilfrolund
    Participant
    This reply has been set as private.
    #168371
     emilfrolund
    Participant
    This reply has been set as private.
    #168482
     Radu
    Moderator

    Hi,

    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 solution
    #168520
     emilfrolund
    Participant
    This reply has been set as private.
    #168669
     Radu
    Moderator

    Hi,

    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 solution
    #168696
     emilfrolund
    Participant

    Should I add this to the functions.php folder in the KLEO child theme?

    By the way – amazing support, this is great.

    #168791
     Radu
    Moderator

    Hi,

    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 solution
    #168833
     emilfrolund
    Participant

    Thank you!

    #169116
     Radu
    Moderator

    You’re welcome

    Have a nice week

    https://themeforest.net/item/kleo-pro-community-focused-multipurpose-buddypress-theme/reviews/6776630

    Cheers
    R.

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution
Viewing 16 posts - 1 through 16 (of 16 total)

You must be logged in to reply to this topic.

Log in with your credentials

Forgot your details?