Displaying Taxonomy Terms from ACF Repeater Field in Global Block

Hi there,

I’m using Pro v. 2.5.5 and ACF v. 5.8.4.

I’m working on a site for a musician. I’ve used Advanced Custom Fields Pro to create a field group to save album-specific information.

I’m using a repeater field to save a list of the musicians featured on each album.

Inside the repeater field are two sub-fields: first, the musician’s name, saved as a term in a custom taxonomy I set up, called Musicians. The second sub-field is a simple text field, with the instrument credit.

Within ACF, I set the taxonomy sub-field so that it returns the Term Object, rather than the Term ID.

I’d like to display all of this data on an Album page, like this:

John Doe, guitar
Jane Roe, bass
Jane Doe, drums

I’ve created an “Album Personnel” Global Block for the purpose. I used this code to create a shortcode that loops through repeater fields.

Here’s the shortcode within the Global Block:

[acf_repeater field=“album_personnel” sub_fields=“personnel_name,personnel_instrument”]
%personnel_name%, %personnel_instrument%
[/acf_repeater]

That should display the term from the custom taxonomy (the musician’s name) followed by a comma and the credited instrument.

On the front end, this shortcode has made my the contents of the page disappear (though not the header). In the editor, however, I can see a preview of the results, which you can see here:

I see that it returns the text field just fine, but in place of the actual term from the taxonomy, it simply shows “Object.”

Can you tell me how to edit the shortcode function so that it 1.) doesn’t break my page; and 2.) retrieves and displays the actual taxonomy term from within the Object?

Hello @dm3,

Thanks for writing in!

Please understand that the ACF Repeater shortcode is a 3rd party code. If there is some issues or error in displaying the output, you may need to contact the original coder for troubleshooting.

Regards.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.