I try to add space to a string in a WordPress template:
<p class="event"><?php the_field( 'date' ) . " " . the_field( 'lieu' ) . " " . the_field( 'nom_de_levenement' ) ?></p>
The problem is that you are trying to use the fields as strings, but the_field
displays the field. You should be using get_field
if you need it to return a string instead of displaying it. Once you combine the strings, you can just echo them all at once.
<p class="event"><?php echo get_field('date') . " " . get_field('lieu') . " " . get_field('nom_de_levenement') ?></p>