0

I have a hobby site where I record the changing tenants of a big shopping centre. For each tenant I create a post and use a ACF repeater to store the unit they are in and open/close dates. The unit uses a custom taxonomy called unit_num. Posts will not have this taxonomy assigned to them (like how post categories and tags are).

Screenshot of ACF repeater in the editor: ACF repeater in editor

I would like to view the unit_num taxonomy archive (defaults to site.com/unit_num/123) and have it query the ACF repeater for tenants that have that taxonomy. Right now it (correctly) says no posts found.

Should I disable the taxonomy archive (public => false) and create a custom permalink (with add_rewrite_tag/add_rewrite_rule)?

1 Answer 1

0

I decided to do what I suggested at the end of the post:

  • public => false in the taxonomy settings
  • Add add_rewrite_tag/add_rewrite_rule to 'unit_num' and add a pre_get_posts action to tweak the query when get_query_parm('unit_num') is set.

This is all working well now. (Often when you write a problem out on a forum it triggers a new outlook on the issue)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.