This topic has 1 reply, 2 voices, and was last updated 9 years by Laura.

  • Author
  • #126041
     Salamsurfing
    Participant

    Hi !!

    First of all thank you for this wonderful theme.

    I use kleo theme with buddypress on my multilingual website. I want show certain profile fields in member directory and member profile header. So I used the code below in bp-custom.php:

    // Here is one way you could add xprofile fields name as well
    // as the value to the members directory! Just remember to
    // replace “Field-Name” with the names of your fields in the
    // 5 variables in my code. Also remember it is case sensitive.
    // If you notice the pattern of 5 in my code you can easily
    // see how to add more fields if you need them. Place this
    // code in bp-custom.php between opening and closing php tags:
    add_action(‘bp_directory_members_item’, ‘bphelp_dpioml’);
    function bphelp_dpioml(){
    $bphelp_my_profile_field_1=’Field-Name’;
    $bphelp_my_profile_field_2=’Field-Name’;
    $bphelp_my_profile_field_3=’Field-Name’;
    $bphelp_my_profile_field_4=’Field-Name’;
    $bphelp_my_profile_field_5=’Field-Name’;
    if( is_user_logged_in() && bp_is_members_component() ) { ?>
    <div class=”bph_xprofile_fields” style=” margin-left: 25%;”>
    <?php echo $bphelp_my_profile_field_1 ?>:&nbsp;<?php echo bp_member_profile_data( ‘field=’.$bphelp_my_profile_field_1 ); ?><br />
    <?php echo $bphelp_my_profile_field_2 ?>:&nbsp;<?php echo bp_member_profile_data( ‘field=’.$bphelp_my_profile_field_2 ); ?><br />
    <?php echo $bphelp_my_profile_field_3 ?>:&nbsp;<?php echo bp_member_profile_data( ‘field=’.$bphelp_my_profile_field_3 ); ?><br />
    <?php echo $bphelp_my_profile_field_4 ?>:&nbsp;<?php echo bp_member_profile_data( ‘field=’.$bphelp_my_profile_field_4 ); ?><br />
    <?php echo $bphelp_my_profile_field_5 ?>:&nbsp;<?php echo bp_member_profile_data( ‘field=’.$bphelp_my_profile_field_5 ); ?><br />
    </div><?php
    }
    }

    It works well. But my problem is that when I switch language, the fields appear to be in the default language. How can I have the fields display in other languages used on my website ?

    Kind regards,

    Kams

     

     

    #126125
     Laura
    Moderator
    Not marked as solution
Viewing 2 posts - 1 through 2 (of 2 total)

The forum ‘Bugs & Issues’ is closed to new topics and replies.

Log in with your credentials

Forgot your details?