Issues with ACF Repeaters and taxonomies

Hi. I’d appreciate some help with the following issue.

I created a Repeater field with ACF Pro called usecases.

Each repeater has a series of sub-fields:

  • usecase < this maps to a taxonomy that can be multi-select
  • vendor < same: mult-select taxonomy
  • etc.

I try to display the subfields as follows:

<Loop acf_repeater=usecases>
<Field usecase />
</Loop>

but this is clearly wrong because all I get in return is a series of [IDs] instead of the names of each use case defined in the taxonomy.

What is the most efficient way to display the names?

Do I have to use set and get with a nested loop for the taxonomy? Or is there an easier syntax that does the job for me at the Loop or Field level in the example above?

I couldn’t find an answer in the documentation.

Thank you

The ACF Taxonomy Field should also be rendered using a loop, so your code should look like this:

<Loop acf_repeater=usecases>
  <Loop acf_taxonomy=usecase>
    <Field title />
  </Loop>
  <Loop acf_taxonomy=vendor>
    <Field title />
  </Loop>
</Loop>

So much cleaner than my set/get/loop solution. Thank you, it works perfectly.

P.s.: my previous attempts at this approach failed because I tried loop taxonomy=... instead of loop acf_taxonomy=...

I hope it will help others avoid the same mistake.

1 Like