Add space between looper text

Hi team,

I’ve created CPT, ACF and loopers to automatically create our meet the team page. some of the employees work at both locations (which is pulled through as an ACF taxonomy). When it comes through, it puts a comma between the locations and no space. Two questions:

  1. is there a way to add a space so it reads Prosper, Melissa rather than Prosper,Melissa
  2. is there a way to replace the comma with an &

This is in “the team” section on the meet the team page
https://gentlecreekdental.flywheelstaging.com/meet-the-team/

Thanks so much!
Ashley

Hello @texaskiwi13,

Thank you for the inquiry.

You can fix this with a Twig template, but for some reason, this feature is not available in your installation.

{{ "Prosper,Melissa" | replace({',': ', '}) }}

Would you mind validating your installation using your license key wp-admin/admin.php?page=x-addons-home?

https://theme.co/docs/product-validation

To enable Twig, please check this documentation.

https://theme.co/docs/twig

We’ll check the site again once it’s validated.

Best regards.

Thanks Ismael!

I’ve updated everything and enabled Twig. I believe I’ve setup the template, but am unsure as to how to implement the change. Note that Prosper, Melissa would be the minimum change I would like to achieve, but ideally, it would be able to read Prosper & Melissa. Note that these terms are pulling from the CPT taxonomy office location.

Thanks!!

Thank you for the update.

We switched to a Twig template instead of using the replace filter.

{% set locations = acf.post_field({"field":"location"}) %}

{% for location in locations %}
   {{ location }}{% if not loop.last %}, {% endif %}
{% endfor %}

Let us know if you need more info.

Best regards.

Thanks! You’re teh best!

You are most welcome, Ashley.