Home Forums General Issues Is this possible?


Is this possible?

  • I have a Field Group Repeater that works within a Custom Post Type.
    I also have Custom Taxonomy that is easily picked up by the Repeater, i.e. when I select the Custom Taxonomy I can – so all good.
    The Custom Taxonomy is “US States” that lists out the US States….all simple stuff…..
    However, I have two questions regarding things that don’t work:
    If I select a State from within the Custom Taxonomy then ACF Repeater easily finds, for example “New York”, however, it is then not listed as being “counted” in the actual Taxonomy itself. What I mean is that if you visit the actual Custom Taxonomy Page the New York page has “0” despite the fact that it has been selected
    Also, is it possible to list or loop attributed posts in that Custom Taxonomy
    Hope that all makes sense and thanks for all replies!

  • The answer is Yes and also No.

    Yes because a taxonomy field can be set to save and load terms. This will do what you want.

    No because you have the taxonomy field in a repeater and this causes save and load terms to not work correctly.

    In order to do this you need to do 1 of 2 things.

    1) Rework the site so that you do not need a repeater.

    2) Add custom PHP code to the site to correctly save terms. To do this you need to create an acf/save_post filter. In this filter you would loop over the repeater and collect a list of terms and then use the WP function to set the post terms.

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.