[Resuelto] Is there a way to filter on a relationship OR a taxonomy?
Este hilo está resuelto. Aquí tiene una descripción del problema y la solución.
Problem:
Is there a way to filter on a relationship OR a taxonomy?
Solution:
There is no such feature available to apply "OR" condition as when you add filter for related posts that means those posts should be included by default.
What if you try to use view's filter wpv_filter_query:
This support ticket is created hace 6 años, 4 meses. 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.
Tell us what you are trying to do?
I need to show product specific documents (connected to products via a relationship of documents related to this product) and also documents in the same product category as the product. When I add a taxonomy filter and relationship filter, the option to choose whether to AND or OR the filters is not presented in the View editor. It appears to default to AND as I'm not getting any results with both filters in place.
The issue is that most products have only 1 product specific document related to them and 5 or 6 product category documents. If I use two Views, I can get the content I want but it looks bad because the product specific view will show one document in an entire row then the product category view will show some number of documents. Visually it would be much better if the product category documents follow the product specific document(s) in the next column in the same row (using Bootstrap for the loop outputs).
If I can't OR these filter types, is there a way to have two Views output into ONE Bootstrap grid without breaking the column counter? I thought about pulling the rows out of the Views and putting them in manually as a single row and letting the columns drive the wrapping but I'd like to keep the rows if possible in case not all items are the same height and so I can add margin between rows.
Is there any documentation that you are following?
The normal Views documentation.
Is there a similar example that we can see?
The desired output is what any single View would be able to output. But I need to get the Product Document CPTs from two filters in an OR relationship that doesn't seem to be possible with the specific filters I need to use:
Select posts in a Product Specific Documents relationship that are related to the Post where this View is shown.
Select posts with taxonomy:
Product categories the same as the page where this View is shown
What is the link to your site?
Go to enlace oculto and then the Documents tab mid-page. You'll see the two separate rows from the two Views I'm using now.
Hello. Thank you for contacting the Toolset support.
Well - thats correct, there is no such feature available to apply "OR" condition as when you add filter for related posts that means those posts should be included by default.
Thanks for confirming that there isn't a way to do this in Views.
If I have to write the code to modify the query with pre_get_posts, I might as well just write my own queries and output them in Bootstrap the way I need the results and not use Views for this particular need. It'd actually be easier to do that than to figure out what to do to the query in the filter.
I've been running across a lot of cases where it would be really valuable to be able to use the output of more than one View in a single Bootstrap grid. I haven't thought a lot about what this would look like in Toolset but perhaps the developers could give some thought to how a 3rd view might be used to format the output of 2 or more other views in a single table, bootstrap grid, list, etc. in a future release.