Replies
- calu on October 23, 2018 at 12:02 am in reply to: Code Snippet 'Add Xprofile fields to the member code' #18200
I am using Generatepress with a child theme. The Buddypress was not present, so I created this folder path:
Generatepress_child >buddypress>members>members-loop.php where I copied the members loop.php, and left the original in place - calu on October 22, 2018 at 11:54 pm in reply to: Code Snippet 'Add Xprofile fields to the member code' #18198This reply has been marked as private.
- calu on October 22, 2018 at 11:25 pm in reply to: Code Snippet 'Add Xprofile fields to the member code' #18196This reply has been marked as private.
- calu on October 22, 2018 at 11:24 pm in reply to: Code Snippet 'Add Xprofile fields to the member code' #18195This reply has been marked as private.
- calu on October 22, 2018 at 11:19 pm in reply to: Code Snippet 'Add Xprofile fields to the member code' #18193This reply has been marked as private.
- calu on October 22, 2018 at 11:10 pm in reply to: Code Snippet 'Add Xprofile fields to the member code' #18191
No, sorry, I put the code before the closing tag, but no values. I am not a Jedi master in PHP, so It could be my lack of skills…
Are backtick’s around ID or name not necessary? - calu on October 22, 2018 at 10:49 pm in reply to: Code Snippet 'Add Xprofile fields to the member code' #18187
Is this the right place to insert the snippet?
Sorry it does not show anything in the fields, so a snippet for bp-custom.php would be much appreciated, thanks.<?php
/***
* If you want to show specific profile fields here you can,
* but it’ll add an extra query for each member in the loop
* (only one regardless of the number of fields you show):
*
* bp_member_profile_data( ‘field=the field name’ );
*/
?>
<?php echo xprofile_get_field_data( ‘578’, bp_get_member_user_id() );?>
</div>Regards
Carsten - calu on October 22, 2018 at 2:44 pm in reply to: Code Snippet 'Add Xprofile fields to the member code' #18179
Hi Brajesh, I found the members-loop under the template pack and copied it to my child theme. So far so good.
I inserted the code here inside members loop copied the field ID 578 to the ‘Date Field Name’ as described (wp-admin/users.php?page=bp-profile-setup&mode=edit_field&group_id=1&field_id=578)But still no luck. Obviously this is not the right place to place the code?
`/**
* Fires inside the display of a directory member item.
*
* @since 1.1.0
*/
do_action( ‘bp_directory_members_item’ ); ?><?php
/***
* If you want to show specific profile fields here you can,
* but it’ll add an extra query for each member in the loop
* (only one regardless of the number of fields you show):
*
* bp_member_profile_data( ‘field=the field name’ );
*/<?php echo xprofile_get_field_data( ‘578’, bp_get_member_user_id() );?>
?>
</div><div class=”action”>
<?php`
Regards
Carsten - calu on October 20, 2018 at 12:03 pm in reply to: Code Snippet 'Add Xprofile fields to the member code' #18162
Hi again, I am sorry, but I can’t get it to work.
I inserted the snippet in bp-custom.php, changed ‘Date Field Name’ with ‘age’ according to the profile field, but it does not show the value.
‘For efficiency, you can replace the field name with id too.’
Please explain what you mean by this?Regards
Carsten - calu on October 16, 2018 at 7:23 pm in reply to: Code Snippet 'Add Xprofile fields to the member code' #18119
Thanks again, Brajesh