This topic has 29 replies, 6 voices, and was last updated 9 years by sharmstr.

  • Author
  • #42960
     diamondbybold
    Participant

    Hi,
    I want to add more information of the users directly in the members box of the members list. (exemple in attachments)
    Any idea how can I do that?

    Thanks

    Attachments:
    You must be logged in to view attached files.
    #42963
     Laura
    Moderator

    Hello, you can use this code:

    COPY CODE
    
    add_action('after_setup_theme','kleo_my_member_data');
    function kleo_my_member_data() 
    {
        global $kleo_config;
        //this is the details field, right now it take the "About me" field content 
        $kleo_config['bp_members_details_field'] = 'About Me';
        //this display the fields under the name, eq: 36 / Woman / Divorced / Berlin. Modify with the names of the fields you want to appear there
        $kleo_config['bp_members_loop_meta'] = array(
            'I am a',
    		'Marital Status',
            'Country',
    		'City'
        );
    }
    

    Add it inside functions.php in child theme

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

    Laura Solanes - Graphic Designer and Web Designer

    Please be patient as I try to answer each topic as fast as i can.

    If you like the theme or the support you've received please consider leaving us a review on Themeforest!

    Always happy to help you 🙂

    #43188
     diamondbybold
    Participant

    Thanks Laura, could you please explain the code a little better?

    In the $kleo_config[‘bp_members_details_field’] = ‘About Me’; line I should change the “About Me” to the name of the fields group that in my case is “Geral”?
    In the $kleo_config[‘bp_members_loop_meta’] = array line I should put the names of the fields of that group like Username, Nationality, Height, Weight, etc. in the array?

    I tried that without success.

    Thanks

    #43221
     Laura
    Moderator

    Hello, “About Me is the name of the field that you want to show under the name like for example “I’m a single girl from London” or maybe you want to put there “Music” To show “Rock,Pop…”

    Then the ‘I am a’ , ‘City’ etc… Are the fields that appear next to the aye ( 20 / Woman / London) Just change About me with the field you want to add, and City, I am a etc with the other fields you want.

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

    Laura Solanes - Graphic Designer and Web Designer

    Please be patient as I try to answer each topic as fast as i can.

    If you like the theme or the support you've received please consider leaving us a review on Themeforest!

    Always happy to help you 🙂

    #43243
     diamondbybold
    Participant

    So, if I understand, those fields are static.
    There’s any way I can get the content of specific fields I have created through the “Advance Profiles” component of Buddypress?

    #43297
     Laura
    Moderator

    Hello, in Users > Profile fields , all of those fields can be used with the code, you just have to change the code name with the field name

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

    Laura Solanes - Graphic Designer and Web Designer

    Please be patient as I try to answer each topic as fast as i can.

    If you like the theme or the support you've received please consider leaving us a review on Themeforest!

    Always happy to help you 🙂

    #44160
     diamondbybold
    Participant

    I add the next code to functions.php:

    COPY CODE
    add_action('after_setup_theme','kleo_my_member_data');
    function kleo_my_member_data() {
        global $kleo_config;
        //this is the details field, right now it take the "About me" field content 
        $kleo_config['bp_members_details_field'] = 'Geral';
        //this display the fields under the name, eq: 36 / Woman / Divorced / Berlin. Modify with the names of the fields you want to appear there
        $kleo_config['bp_members_loop_meta'] = array(
            'Username',
    		'Nome',
    		'Apelido'
        );
    }

    You can see in the print attached that I have those camps in Profile Fields but the Memebers box don’t show any of them.

    Attachments:
    You must be logged in to view attached files.
    #44197
     Laura
    Moderator

    Hello, Geral is not a field, is the group, Geral need to be changed to a name of a field, like “About Me”, a field that has long text.

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

    Laura Solanes - Graphic Designer and Web Designer

    Please be patient as I try to answer each topic as fast as i can.

    If you like the theme or the support you've received please consider leaving us a review on Themeforest!

    Always happy to help you 🙂

    #45938
     fher012
    Participant

    I think I am having the exact same challenge. Below is the code snippet that I have included in the child function.php. I also cleared the cache as I saw reference to doing that somewhere else. Can I confirm if I am doing this correctly? I have tried various combinations of using field name or field groups, so not sure if something else is the issue.

    add_action(‘after_setup_theme’,’kleo_my_member_data’);
    function kleo_my_member_data()
    {
    global $kleo_config;
    //this is the details field, right now it take the “About me” field content
    $kleo_config[‘bp_members_details_field’] = ‘About Me’;
    //this display the fields under the name, eq: 36 / Woman / Divorced / Berlin. Modify with the names of the fields you want to appear there
    $kleo_config[‘bp_members_loop_meta’] = array(
    ‘Favorite Quote’
    );
    }

    Attachments:
    You must be logged in to view attached files.
    #45967
     Laura
    Moderator

    Hello, can you share your ftp and website so i can check it out?

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

    Laura Solanes - Graphic Designer and Web Designer

    Please be patient as I try to answer each topic as fast as i can.

    If you like the theme or the support you've received please consider leaving us a review on Themeforest!

    Always happy to help you 🙂

    #46015
     diamondbybold
    Participant

    Please share the problem when you find it, I also can’t show the fields.

    #46114
     troy7890
    Participant

    Not working for me either –

    Does the member details field need to be the field id name?

    $kleo_config['bp_members_details_field'] = 'Favorite Game Character?';
    Or
    $kleo_config['bp_members_details_field'] = 'field_112';

    #46141
     Laura
    Moderator

    Hello, the name should match as it shows in profile fields

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

    Laura Solanes - Graphic Designer and Web Designer

    Please be patient as I try to answer each topic as fast as i can.

    If you like the theme or the support you've received please consider leaving us a review on Themeforest!

    Always happy to help you 🙂

    #46154
     troy7890
    Participant

    Hmm, that’s what I have now.

    http://boardgamersleague.com/player-info/members/

    Attachments:
    You must be logged in to view attached files.
    #46156
     troy7890
    Participant

    Sorry – wrong photo screenshot uploaded.
    From the link above you’ll see that the only profile fields that are loading are the item title and the itme meta “activity”.

    Thanks for your help.
    This will be a nice addition to a great community theme.

    Attachments:
    You must be logged in to view attached files.
    #46382
     Laura
    Moderator

    Hello, in the 114 line you dont have a ? after character, as your field shows

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

    Laura Solanes - Graphic Designer and Web Designer

    Please be patient as I try to answer each topic as fast as i can.

    If you like the theme or the support you've received please consider leaving us a review on Themeforest!

    Always happy to help you 🙂

    #46463
     troy7890
    Participant
    This reply has been set as private.
    #46614
     troy7890
    Participant

    Just a public comment that adding the ? to the line had no effect on getting the fields to display.

    #46796
     Andrei
    Moderator

    Hi, please let us your ftp credentials so we can give a look at what’s wrong in your code.
    Remind to set the reply as private.

    Thanks.

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution
    #46799
     troy7890
    Participant
    This reply has been set as private.
    #46802
     sharmstr
    Moderator

    @troy7890 you forgot to put the add_action line. Merely adding the function but not calling the function wont do anything. Look at the code again in the first post.

    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

    #46811
     troy7890
    Participant

    Thank you sharmstr. My bad, apparently my hand didn’t copy the first line (which is overlapped when you select the code BTW). Totally my bad.

    However, after adding that action and flushing the cache, still nothing changed on my members page. Weird.

    #46821
     sharmstr
    Moderator

    I feel like the above code is for sweetdate. Try this instead.

    COPY CODE
    
    add_action( 'bp_profile_header_meta', 'display_user_info' );
    function display_user_info() {
    	bp_profile_field_data('field=Favorite Game Character?');
    	echo "</br>";
    	bp_profile_field_data('field=City');
    } 
    
    
    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

    #46825
     troy7890
    Participant

    Thanks, but even with that new code, we still got nothin.

    #46826
     sharmstr
    Moderator

    Huh? I see 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

    #46827
     sharmstr
    Moderator

    Also, if you want to add the field name before it, change it to this

    COPY CODE
    
    add_action( 'bp_profile_header_meta', 'display_user_info' );
    function display_user_info() {
    	echo "Favorite Game Character?: " . bp_profile_field_data('field=Favorite Game Character?');
    	echo "</br>";
    	echo "City: ". bp_profile_field_data('field=City');
    }
    
    
    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Ticket solution

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

    #46828
     sharmstr
    Moderator

    I’m an idiot. I was thinking the member profile. Please hold.

    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

    #46829
     sharmstr
    Moderator

    Try this instead

    COPY CODE
    
    add_action( 'bp_directory_members_item', 'display_user_info' );
    function display_user_info() {
    	echo "Favorite Game Character?: " . bp_profile_field_data('field=Favorite Game Character?');
    	echo "</br>";
    	echo "City: ". bp_profile_field_data('field=City');
    }
    
    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

    #46838
     troy7890
    Participant

    Thanks so much sharmstr.
    So we’re getting really close to doing what the original topic of this thread requested. Here’s what my page looks like now – You’ll see that the field titles are displaying from the function, but not the field data.
    http://boardgamersleague.com/player-info/members/

    Using your bp_profile_header_meta that you posted, I’m able to get that to work on the member profile page fine. But for some odd reason, the field data is displaying before the field title. (see attached)

    We’re getting close! Thanks!

    Attachments:
    You must be logged in to view attached files.
    #46875
     sharmstr
    Moderator

    I forgot to change another bit of the code when I copied it over. Sorry. Try this

    COPY CODE
    
    add_action( 'bp_directory_members_item', 'display_user_info' );
    function display_user_info() {
    	echo "Favorite Game Character?: ";
    	bp_member_profile_data('field=Favorite Game Character?');
    	echo "</br>";
    	echo "City: ";
    	bp_member_profile_data('field=City');
    }
    

    and some css to center it.

    COPY CODE
    
    #buddypress #members-list div.item {
    text-align: center;
    }
    
    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

    Attachments:
    You must be logged in to view attached files.
Viewing 30 posts - 1 through 30 (of 30 total)

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

Log in with your credentials

Forgot your details?