Skip Navigation

[Resuelto] Conditional Ooutput -Comparing Two Custom Post Types Without Post Relationship

This support ticket is created hace 6 años. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Hoy no hay técnicos de soporte disponibles en el foro Juego de herramientas. Siéntase libre de enviar sus tiques y les daremos trámite tan pronto como estemos disponibles en línea. Gracias por su comprensión.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Hong_Kong (GMT+08:00)

Este tema contiene 5 respuestas, tiene 2 mensajes.

Última actualización por Luo Yang hace 6 años.

Asistido por: Luo Yang.

Autor
Mensajes
#1148095

Tell us what you are trying to do?

I have two custom post types, Houses and Buyers. I am trying to compare a custom field (house-type-house) from custom post type Houses to (house-type-buyer) from custom post type Buyer.

I'd like to create a view that for example when I select a buyer lists all the houses that meet their criteria based on their set of custom fields.

I appreciate that post relationships can do this if I manually link each buyer to a house but that's not practical.

I would like one company to be able to log in and list a property and then have a view with "Recommended Buyers" built into the content template once it's created and vice versa I'd like another company to list a buyer and then have a view with "Recommended Houses" built into their content template.

Is this possible, I feel it is but can't figure it out?

#1148987

Hi,

How do you setup the custom fields "house-type-house" and "house-type-buyer"?
If they are multiple choices custom checkboxes fields, I suggest you use a custom hierarchical taxonomy "house-type" to replace it:
https://toolset.com/documentation/user-guides/create-custom-taxonomies/

Register taxonomy "house-type" to both post types:
- house
- buyer

In a single "buyer" post, you can create a nested view:
1) Parent taxonomy view, query terms of taxonomy "house-type", filter by terms assigned to current post
2) Child post view, query posts of "house" post type, filter by "house-type" term from parent taxonomy view.

More help:
https://toolset.com/documentation/user-guides/using-a-child-view-in-a-taxonomy-view-layout/

#1149197

Ah brilliant, thanks Lou, this is a great start.

Would it be possible to take this one stage further and filter the results more based on a radius of the post types respective address fields?

Los hilos nuevos creados por Luo Yang y vinculados a este se encuentran a continuación:

https://toolset.com/es/forums/topic/filter-the-results-more-based-on-a-radius-of-the-post-types-respective-address-fields/

#1149654
#1152444

I'm not too sure if it is resolved but I'm parking the issue for a while. Would it be possible to keep the ticket open? No problem if not.

#1152884

OK, please update this thread if you need more assistance for it, thanks