I am really new at php , so sorry for this very basic question;
i have created a new field ‘image’ for users ‘freelancer’.
Then, I try to display the result on each profile page.
THis is where I am stuck.
I tried this:
<?php the_field('badge', 'user_id'); ?></p>
and i really don’t know how to do the echo.
I als tried this:
$image = get_field('$badge_id', '$user_id');
if( !empty($image) ): ?>
<img src="<?php echo $image['url']; ?>" />
<?php endif; ?>
$image = get_field('badge');
var_dump( $badge );
I also tried the var_dump and it returns BOOL(FALSE)
Anyone, please can help?
Many thanks, and sorry again for this very basic question i guess!
I got this message on the front end :
NOTICE: UNDEFINED VARIABLE: BADGE IN /HOME/PROFILE.PHP ON LINE 43
Thank you for your help
The problem in this scenario is that, either you do not have a custom field named badge or you have not set the field group which contains the field badge to show on the homepage.
I hope this helps.