This topic has 14 replies, 2 voices, and was last updated 10 years by sharmstr.

  • Author
  • #14100
     Jonbie
    Participant

    I am looking to add a single profile field I have created (Type of account) to the information displayed when on the members directory page (in users individual profile boxes, under there names).

    I would also like to place the same field next to the users name on the top of there buddypress pages if possible?

    I do not have enough knowledge to implement it myself as what i have researched hasn’t worked for me.

    anyone have any experience of this?

    #14108
     sharmstr
    Moderator

    Did you try this? http://bp-tricks.com/snippets/displaying-certain-profile-fields-on-your-members-profile-page/

    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

    #14111
     Jonbie
    Participant

    Hi Sharmstr,

    I actually spent the day trying to get that exact article to work for me but i just couldn’t get it.

    maybe you could tell me if this looks right?

    <div id=”item-buttons”>

    <?php do_action( ‘bp_member_header_actions’ ); ?>

    </div><!– #item-buttons –>

    <?php
    <div id=”member_profile”>
    <div class=”profile_fields”>Category: <span><?php bp_profile_field_data( ‘field=Type of account’ );?></span></div>
    </div>
    do_action( ‘bp_profile_header_meta’ );

    ?>

    </div><!– #item-meta –>

    #14113
     sharmstr
    Moderator

    Looks like you’re php is a screwed up. You can’t call html within the php tags.

    Lets back up. Did you copy the file from the Kleo directory and put it in your child theme?

    copy /Kleo/Buddypress/members/single/member-header.php
    to /Kleo-child/Buddypress/members/single/member-header.php

    on like 53 it tells you to add any additional profile fields there. So add the following on line 56 (you want it above the bp_profile_header_meta action call.

    COPY CODE
    
    
    ?>
    <div id='member_profile'>
    <div class='profile_fields'>Category: <span><?php bp_profile_field_data( 'field=Type of account' );?></span></div>
    </div>
    <?php
    
    

    Works perfect for me.

    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

    #14115
     Jonbie
    Participant

    Hey sharmstr,

    Still no luck with that, the page i am trying to get that profile field to show up on is audiokulture.com/members ,

    im not getting any errors but it still is not showing up?

    #14116
     sharmstr
    Moderator

    Well that’s the wrong page. You said “I would also like to place the same field next to the users name on the top of there buddypress pages if possible?” and the link I sent you was about adding it to that page, so I was showing you how to do that. You can use the same code in kleo/buddypress/members/members-loop.php. Add it to line 69 (I didnt do this on purpose.)

    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

    #14117
     Jonbie
    Participant

    Im actually looking to add it to both places, and i confuse myself sometimes 😉

    i will try that now.

    #14118
     Jonbie
    Participant

    The category title is coming up but not the type of account details, the field id is 5, i drop the ‘?

    ?>
    <div id=’member_profile’>
    <div class=’profile_fields’>Category: <span><?php bp_profile_field_data( field_id= 5 );?></span></div>
    </div>
    <?php

    #14121
     sharmstr
    Moderator

    Is that a question? I’m confused.

    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

    #14122
     Jonbie
    Participant

    sorry, badly worded.

    As the field is not showing i was going to try using the id instead of the name. The id is 5 im just not 100% sure of code for it, is it (field_id= 5);?> or do i include the ‘

    #14123
     sharmstr
    Moderator

    I know for sure it works with the field name. Something weird is going on over there. For the heck of it, have you tried a different field? That way you’d know if it was a field or code issue. Maybe…

    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

    #14124
     Jonbie
    Participant

    Hey, yea i tried a few different fields but nothing is showing other than “Category”

    #14141
     sharmstr
    Moderator

    Well, at this point, I dont think I can help without access to the site.

    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

    #14573
     Jonbie
    Participant

    Hi Sharmstr,

    I have finally found out what is happing with that code you sent me.

    The category is visible when you are viewing your friends in the friends tab but not visible when searching members in the members directory.

    any idea on why this is happening?

    #14575
     sharmstr
    Moderator

    If you read line 67 in members-loop it says you need to use bp_member_profile_data instead of bp_profile_field_data.

    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 15 posts - 1 through 15 (of 15 total)

The topic ‘Adding 1 profile field to members directory’ is closed to new replies.

Log in with your credentials

Forgot your details?