Skip to:
Content
Pages
Categories
Search
Top
Bottom

show profile data in specific groups


  • olafnekeman
    Participant

    @olafnekeman

    I have the following profile field: ‘Jouw 06’. i’ve inserted the following code in groups/single/members.php file in order to show that profile field in the group-loop. this works.

    <?php 
    <?php if ( xprofile_get_field_data( 'Jouw 06', $user_ID ) ) :?>
    <?php echo xprofile_get_field_data( 'Jouw 06', $user_ID );?>
    <?php endif;}?>
    

    now i’m trying to show this profile data in a specific group. I’ve come up with the following:

    <?php 
    if (bp_group_id('5')){
    <?php if ( xprofile_get_field_data( 'Jouw 06', $user_ID ) ) :?>
    <?php echo xprofile_get_field_data( 'Jouw 06', $user_ID );?>
    <?php endif;}?>
    ?>
    

    but this doesn’t show the profile data in the specific group.
    How can I show profile data in a specific group?

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

  • shanebp
    Moderator

    @shanebp

    Try

    if( bp_get_group_id() == 5 ) 
    
    or 
    
    if( bp_get_group_id() == '5' ) 

    olafnekeman
    Participant

    @olafnekeman

    Thanks for your input!!!!
    i’ve got it working now!
    for anyone who’s having trouble with the same issue, here the code:

    <?php if( bp_get_group_id() == 5){
    if ( xprofile_get_field_data( 'Jouw 06', $user_ID ) ) :
    echo xprofile_get_field_data( 'Jouw 06', $user_ID );
    endif; 
    }
    
    
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘show profile data in specific groups’ is closed to new replies.
Skip to toolbar