Skip Navigation

[Résolu] VIEWS add search filter from post relationship

This support ticket is created Il y a 3 années et 8 mois. 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.

No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.

Sun Mon Tue Wed Thu Fri Sat
- 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10: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/Kolkata (GMT+05:30)

Marqué : ,

This topic contains 7 réponses, has 2 voix.

Last updated by leilaG Il y a 3 années et 7 mois.

Assisted by: Minesh.

Auteur
Publications
#1738699

We have post types 'Companies' and 'Rooms'

Taxonomy 'Location' is connected to 'Rooms' post type

We have a VIEW displaying 'Companies' post type how do we add a filter to search by 'Location'

#1739031

Minesh
Supporter

Languages: Anglais (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hello. Thank you for contacting the Toolset support.

Thats not possible as you can only add the filters to the view for the fields/taxonomy which is attached to the post type to which you set your view to query.

You can not add filters for fields/taxonomy which belongs to other post type.

To add a taxonomy filter to your view, your taxonomy "Location" should be attached to post type "Companies".

#1739349

Is that the case, even if 'Companies' and 'Rooms' are a post relationship?

#1741485

Minesh
Supporter

Languages: Anglais (English )

Timezone: Asia/Kolkata (GMT+05:30)

Yes - Views can display the content or query the content or you can add the query filters for the post type to which you set the view to query.

So, you created the view to display the content from "Companies" post type and taxonomy "Location" is actually attached to "Rooms" post type that is why you can not add the filter to your view that is set to query the "Companies" post type as taxonomy "Location" is not attached to "Companies" post type.

#1741599

Yes correct and the individual Company pages displays which 'rooms' are related to that 'Company'

#1741825

Minesh
Supporter

Languages: Anglais (English )

Timezone: Asia/Kolkata (GMT+05:30)

I understand your structure but it's simply not possible to add the taxonomy filter that belongs to child post type.

However - if you can share problem URL and access details I would like to check and I'll see if I can be able to share any workaround with you.

*** Please make a FULL BACKUP of your database and website.***
I would also eventually need to request temporary access (WP-Admin and FTP) to your site. Preferably to a test site where the problem has been replicated if possible in order to be of better help and check if some configurations might need to be changed.

I have set the next reply to private which means only you and I have access to it.

#1745547

Minesh
Supporter

Languages: Anglais (English )

Timezone: Asia/Kolkata (GMT+05:30)

As I tried to explain in my previous reply but again it's simply not possible and support to add a frontend taxonomy filter for the taxonomy which belongs to the child post type (Rooms) to the view of parent post type (company).

You can only add filter for post type to which you set the view to query. In this case - as you can see with your view, your view is set to query the post type "Company" and "Room Location" taxonomy is belongs to post type "Rooms".
=> hidden link

I do not have any solution to offer here as its not supported by design.

#1753605

Okay. Thank you!

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.