Sam
Sam

Reputation: 1461

Adding a space between two ACF fields

I'm using ACF to add certain classes to a . Here's how it looks currently:

<div class="card <?= get_sub_field('colour'); echo ' '.get_sub_field('align_text'); ?>">

As I'm adding multiple classes, I need a space between the colour and align_text field.

What's the correct way to add spaces in this scenario? I feel like my method is a bit hacky.

Upvotes: 0

Views: 911

Answers (1)

geldek
geldek

Reputation: 554

<div class="card <?= get_sub_field('colour').' '.get_sub_field('align_text'); ?>">

Upvotes: 1

Related Questions