Skip to:
Content
Pages
Categories
Search
Top
Bottom

How to add s2member custom registration field to Buddypress member loop ?????


  • vinay24k
    Participant

    @vinay24k

    I have Custom fields of S2 members as follows :
    Gender
    College
    Course

    I want to add these to members profiles under Last Activity. With little nowledge and surfing over internet i found that i need to add a code in Members-loop.php I also found that the following code will do the thing. But it didnt work for me :

    				<?php do_action( 'bp_directory_members_item' ); ?>
    
                                    <?php $theUserID = bp_get_member_user_id();?>
                                    <div id="profile_data">
                                    <span class="profile_fields">
                                    <li><?php echo get_user_field('gender_id', $theUserID);?></li>
                                    <li><?php echo get_user_field('College_name', $theUserID);?></li>
                                    <li><?php echo get_user_field('course_name', $theUserID);?></li> 
                                    </span>
    	</div>

    Please help me to do it right.

Viewing 3 replies - 1 through 3 (of 3 total)

  • vinay24k
    Participant

    @vinay24k

    I am using Latest version of Buddypress and WordPress. Also Default Buddypress theme.


    shanebp
    Moderator

    @shanebp

    Did you review the s2member documentation?
    http://www.s2member.com/codex/stable/s2member/api_functions/package-functions/#src_doc_get_user_field()

    try:
    get_user_field('s2member_gender_id', $theUserID)


    vinay24k
    Participant

    @vinay24k

    This code is working. But its showing Current user custom fields for any profile i visit. But i want Particular user custom field under particular profile. How can i do that ? I tried adding ,123 as suggested in that documentation but getting error

    <?php do_action( 'bp_before_member_header_meta' ); ?>
    
    	<div id="item-meta">
    
    		<?php if ( bp_is_active( 'activity' ) ) : ?>
    
    				<?php do_action( 'bp_directory_members_item' ); ?>
                                    <?php $theUserID = bp_get_member_user_id();?>
                                       <div id="profile_data">
                                    <li><?php echo get_user_field('gender_id', $theUserID);?></li>
                                    <li><?php echo get_user_field('College_name', $theUserID);?></li>
                                    <li><?php echo get_user_field('course_name', $theUserID);?></li> 
                                    </span>
    	</div>
    
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘How to add s2member custom registration field to Buddypress member loop ?????’ is closed to new replies.
Skip to toolbar