This topic has 4 replies, 2 voices, and was last updated 6 years by Laura.

  • Author
  • #213408
     darunia77
    Participant

    Hi guys. I would like to modify the code below so I can also add this to my Group Members directory. Currently I have this for Members directory. Can you please change the function, I couldn’t figure it out myself what the directory is called in php. Thank you.

     

    COPY CODE
    /* Add extra fields to member directory */
    
    
    
    function sq7_extra_fields_members_directory() {
     
        $age = bp_get_member_profile_data('field=Age');
        $city = bp_get_member_profile_data('field=City');
    	$stateorprovince = bp_get_member_profile_data('field=State or Province');
        $country = bp_get_member_profile_data('field=Country');
    	$ldr = bp_get_member_profile_data('field=Open to LDR?');
    
    
     
        if ($age || $city  || $stateorprovince  || $country  || $ldr) {
            echo '<div class="mdetcenter">'. 'Age : ' . $age . '</div>';
            echo '<div class="mdetcenter">'. 'City : ' . $city . '</div>';
    		 echo '<div class="mdetcenter">'. 'State or Province : ' . $stateorprovince . '</div>';
    		echo '<div class="mdetcenter">'. 'Country : ' . $country . '</div>';
    		echo '<div class="mdetcenter">'. 'Open to LDR : ' . $ldr . '</div>';
    
    
    		
        }
     
    }
    #213409
     darunia77
    Participant

    Sorry, missing part of code. The whole code is:

    /* Add extra fields to member directory */

    function sq7_extra_fields_members_directory() {

    $age = bp_get_member_profile_data(‘field=Age’);
    $city = bp_get_member_profile_data(‘field=City’);
    $stateorprovince = bp_get_member_profile_data(‘field=State or Province’);
    $country = bp_get_member_profile_data(‘field=Country’);
    $ldr = bp_get_member_profile_data(‘field=Open to LDR?’);

    if ($age || $city || $stateorprovince || $country || $ldr) {
    echo ‘

    ‘. ‘Age : ‘ . $age . ‘

    ‘;
    echo ‘

    ‘. ‘City : ‘ . $city . ‘

    ‘;
    echo ‘

    ‘. ‘State or Province : ‘ . $stateorprovince . ‘

    ‘;
    echo ‘

    ‘. ‘Country : ‘ . $country . ‘

    ‘;
    echo ‘

    ‘. ‘Open to LDR : ‘ . $ldr . ‘

    ‘;

    }

    }

    add_action(‘bp_directory_members_item’, ‘sq7_extra_fields_members_directory’);

    #213460
     Laura
    Moderator

    Hello, you would need to hire a developer to customize the code for you as we do not provide custom development

    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 🙂

    #213722
     darunia77
    Participant

    Thanks

    #213787
     Laura
    Moderator

    Let me know if you need anything else 🙂

    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 🙂

Viewing 5 posts - 1 through 5 (of 5 total)

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

Log in with your credentials

Forgot your details?