Skip to:
Content
Pages
Categories
Search
Top
Bottom

customize members page


  • capnjazz
    Participant

    @capnjazz

    hi,
    i want to customize members info shown in members list page,

    in the list of all users, i want to show something more than the name and last activity online.
    i created customed fields for the inner-page of the user, but they don’t show in the members list page.

    how can i do this?
    thank you.

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

  • autox420
    Participant

    @autox420

    /plugins/buddypress/bp-templates/bp-legacy/buddypress/members/members-loop.php

    <div class="item">
    <div class="item-title">
    <a href="<?php bp_member_permalink(); ?>">
    <?php bp_member_name(); ?></a>
    <?php if ( bp_get_member_latest_update() ) : ?>
    <span class="update"> <?php bp_member_latest_update(); ?></span>
    <?php endif; ?>
    </div>				
    
    ///////////// <YOUR CODE HERE> <LIKE_GET_THAT_FIELD> ///////////// 		
    				
    <?php
    /**
    * Fires inside the display of a directory member item.
    *
    * @since 1.1.0
    */
    do_action( 'bp_directory_members_item' ); ?>

    Boone Gorges
    Keymaster

    @boonebgorges

    > i created customed fields for the inner-page of the user, but they don’t show in the members list page.

    The details depend on how you created these “customed fields”. If they are xprofile fields, then the simplest way is to do this:

    
    $user_id = bp_get_member_user_id();
    $data = xprofile_get_field_data( 'Custom Field Name', $user_id );
    if ( $data ) {
        echo $data;
    }
    

    If you stored it in user meta, do something similar:

    
    $data = get_user_meta( $user_id, 'custom_field_name', true );
    

    Either way, bp_get_member_user_id() is how you get the ID of the current user in the loop.

Viewing 2 replies - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.
Skip to toolbar