I have a template for our custom content type Rides. We have custom fields for our rides titles Mileage1, Mileage2, and Mileage3. These allow us to include 3 different distance options for each ride.
We are trying to display these fields conditionally. Not all rides will have data in these fields. So we want to conditionally display them with a check to make sure the field is not empty. I have that working correctly already.
But the issue is we want to display these three fields all on one line separated by commas, but they are instead displaying on separate lines.
You can see an example of this here:
hidden link
Look in the right column where it says Miles:
The way we have this set up in the template is three separate conditionals with each field placed inside the conditional.
[wpv-conditional if=" NOT ( empty( $(wpcf-mileage1)) ) " ]<!-- wp:html -->
<div class="tb-field" data-toolset-blocks-field="1" data-last-update="1.4">Miles: [types field='mileage1' output='normal' format='FIELD_VALUE'][/types]</div>
<!-- /wp:html -->[/wpv-conditional]
[wpv-conditional if=" NOT ( empty( $(wpcf-mileage2)) ) " ]<!-- wp:html -->
<div class="tb-field" data-toolset-blocks-field="1" data-last-update="1.4">, [types field='mileage2' output='normal' format='FIELD_VALUE'][/types]</div>
<!-- /wp:html -->[/wpv-conditional]
[wpv-conditional if=" NOT ( empty( $(wpcf-mileage3)) ) " ]<!-- wp:html -->
<div class="tb-field" data-toolset-blocks-field="1" data-last-update="1.4">, [types field='mileage3' output='normal' format='FIELD_VALUE'][/types]</div>
<!-- /wp:html -->[/wpv-conditional]
This may be a simple CSS styling issue I'm not getting right. But it's also possible that my logic is wrong for how I set up the conditionals and placed the fields. We want to make sure that if a Ride has data in Mileage1 and Mileage2, that those two fields will display, but the Mileage3 field will not. We want to make sure that if a Ride has data in Mileage1 only then that will display, but the Mileage2 and Mileage3 fields will not.
I'm thinking this is going to be a very easy one and I'm going to feel stupid for having to file this ticket. But any help you can provide will be appreciated as always.