0

I could use some guidance in something where I may have developed myself into a corner. Here is the situation I have:

  • CPT: Communities
  • CPT: Innovators
  • CPT: Success Stories

Any Innovator or Success story needs to be tied to a Community. I've attempted to do this through a ACF Bidirectional relationship field. I did this instead of a taxonomy because I didn't want them to have to manage a community taxonomy and a community post type every time a new one was added. It also makes listing associated innovators and success stories on a community page relatively simple. The problem is now that I am doing it that way, I can't use the archive system.

What I need to be able to do is list the communities, and have them link to a list of their associated innovators or success stories depending on the intent. Ideally the titles of these listing pages can be dynamic as well. There is an old plugin called CPT-onomies that converts a CPT into a taxonomy for another but I am hesitant to use it since it has been 2 years from last update. Is there an elegant and dynamic solution to this or should I just make taxonomies?

For a visual representation, here is the design. Slides 4 and 5 are good example.

Many thanks.

5
  • You can still convert those fields into taxonomies, and auto-add taxonomy terms on post save and creation via filters. However, listing those posts in an archive will require an expensive meta_query. Post meta is fast when you're retrieving a value and already know the post ID and key, but the table was not designed for finding the post ID when you know the key and value. Support was added as it's still a useful utility to have but was never intended for extensive use, despite that being what happened in the wider WP community. As for 2 years, that is not a long time in the WP ecosystem – Tom J Nowell Jun 10 at 20:20
  • If you are intending this archive to be on a particular page though which already has a bi-directional relationship then that is completely different. If you want to list communities, why not use the communities archive then show the list on the community post template? – Tom J Nowell Jun 10 at 20:25
  • Hi Tom thanks for the help. My brain is getting blocked in how I would list the communities and have them link to their ACF field associated innovators or stories, and not their single pages. It doesn't necessarily need to follow the usual archive logic.. This could be a page template too, but it would nice if the title could be dynamic. Perhaps this image would help illustrate my goal. ibb.co/D1MJ721 – Dave1985 Jun 11 at 0:11
  • do a loop of communities then inside that loop, do another loop of innovators etc. At this point just mocking up the page with dummy HTML then replacing it bit by bit with dynamic parts would be enormously helpful to you, there's a very high chance that what you're struggling with will become super obvious. Also keep in mind ACF and 3rd party plugins are off topic here, nobody can help you with the specific detail of bi-directional fields here – Tom J Nowell Jun 11 at 8:50
  • I think you're right.. this is one case where I'm just going to have to figure it out as I go along and less with a plan. Thank you again. – Dave1985 Jun 11 at 14:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.