I’m using a user field to display a user’s first and last name. The name is displayed but there is an Array field before it :
My code:
<?php echo
$users = get_field('formateur');
foreach ($users as $user) {
$posts = get_field('sessions_a_venir', $user);
}
if( $user ): ?><?php echo $user['user_firstname']; ?> <?php echo $user['user_lastname']; ?>
<?php endif; ?>
The result(Ex: Formateur ArrayJohnDupond)
Thank you in advance
Could you show us more context, please? It seems like that’s something outside of the code you provided. What code comes before that?
Edit: Oh, wait, I just saw this:
You are doing <?php echo
in the very beginning. Remove that echo statement and see if that helps.