Hello
I want to display the custom fields in the templates "post.php" and "topic.php".
Can you tell me how to achieve inclusion in php because I did not find the solution in the documentation.
Waiting to hear from you
MP
Hello
I want to display the custom fields in the templates "post.php" and "topic.php".
Can you tell me how to achieve inclusion in php because I did not find the solution in the documentation.
Waiting to hear from you
MP
Do you have a solution to propose ?
Hi Mister,
You can get the field information and display it by using these functions.
For wpForo 1.4.7 and higher versions use this function:
<?php wpforo_user_field( 'field_name' ); ?>
For 1.4.6 and lower you only can use wpForo User Custom Fields addon functions:
1. This function gets the field information by userId and fieldname and return it. You can print $fieldValue value anywhere you want.
if (function_exists('wpfucfGetField')) {
$fieldValue = wpfucfGetField($userId, $fieldName);
}
2. This function prints the field information by userId and fieldname with before and after html parameters
if (function_exists('wpfucfTheField')) {
wpfucfTheField($userId, $fieldName, $before = '', $after = '');
}
Thank you for the answer.
So if I understand well to display a custom field called "coupdroit" or "bois" or "nomclub", the function will be written as well :
<?php if (function_exists('wpfucfTheField')) {
wpfucfTheField($userId, $coupdroit, $before = '', $after = '');
} ?>
or
<?php if (function_exists('wpfucfTheField')) {
wpfucfTheField($userId, $bois, $before = '', $after = '');
} ?>
or
<?php if (function_exists('wpfucfTheField')) {
wpfucfTheField($userId, $nomclub, $before = '', $after = '');
} ?>
I tried with these examples but it does not work. I tried with a field included in the plugin with for example "site" but it does not work either.
Can you tell me where my mistake comes from?
thank you in advance
MP
Thank you that works well but only for a user.
How to make the & id value suitable for all forum users?
This information is displayed in the user's information and is displayed in the view of everyone.
Thanks you