Custom Post Type Taxonomies Referenced In Another Custom Post Type

Hi,

I am trying to find a way of replicating the following scenario, which I have currently have set up using ACF Relationship fields. In the current set up has been previously discussed here: ACF Pro Relationship Field Not Displaying and ACF Pro Bi-Directional Updates.

However,… for all sorts of reasons, mainly speed, the ACF route has not been great.

I have rebuilt the website by replacing many of the ACF fields with CPT Taxonomies and the speed increase has been enormous. The one exception is the area mentioned in the two posts referenced above.

Is it possible to replicate the set up in the links above, but using CPT Taxonomies?

To recap on the idea, we have two CPTs: Casualties and Memorials.

CPT Casualties has fields including:

  • Name
  • Regiment
  • Memorials (a list of one or multiple memorials from a Taxonomy shared with the next CPT)

CPT Memorials has fields including:

  • Memorial Name (this is the field which should populate “Memorials” in the previous CPT)
  • Memorial Town
  • Memorial Country

Any ideas if I can do this - I have gone brain dead trying to deconstruct the ACF version and trying to work out the CPT Taxonomy replacement! I am sure there must be a simple solution.

Many thanks,
Christopher

Hello Christopher,

Thanks for writing in!

If Memorials is the Taxonomy, you will have to add the name, town, and country to that taxonomy so that when creating/editing Casualties custom post type, you can select the Memorials Taxonomy which is their only connection.

If you set them up as custom post types, there will not be any connection between the two.

Hi @ruenel,

Thank you for your reply. It makes sense. I still wonder if I can make use of taxonomies, rather than the ACF Relationship fields, which cause serious performance issues due to the amount of data being queried (when uploaded there will be approximately 3 million rows in the postmeta table from about 30,000 records).

Each memorial consists of unique:

  • Title
  • Town
  • Country
  • Longitude
  • Latitude
  • Image

The CPT Casualties contain unique Casualty names but can be linked to multiple Memorials. This is simple enough to do.

The complexity, which I have not been able to figure out is whether we can then achieve the reverse - against each memorial, we can list all Casualties associated with the memorial - or can this only be done with ACF Relationships?

I appreciate your help with this concept.

Thanks,
Christopher

Hey Christopher,

That could be possible but what’s certain is that it would take hours of custom development which is beyond the scope of our theme support.

For such a large data, I’d recommend you hire a database specialist to optimize the CPT setup for you or even create a custom database.

Thank you for understanding.

Thank you. It is something I will try to optimise and develop over time!

You’re welcome.

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