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
Our team is currently on holiday, so support will be limited during this period. Response times may be slower than usual, and some inquiries may be delayed. We appreciate your patience and understanding, and we’ll resume our usual support by the end of August.
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