[Gelöst] Setting up taxonomy filter based on post title
This support ticket is created vor 7 Jahren, 2 Monaten. 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.
Heute stehen keine Supporter zur Arbeit im Werkzeugsatz-Forum zur Verfügung. Sie können gern Tickets erstellen, die wir bearbeiten werden, sobald wir online sind. Vielen Dank für Ihr Verständnis.
My scenario is this: I have a number of licensee profile pages. On each licensee page, I want to display posts filtered by a custom taxonomy "event region" (see screenshot 1)
Some of these posts will be national (ie. needing to appear on all licensee pages) and some will be specific to a licensee- i'll need to include all posts with the region set to "national" AND all posts where the taxonomy matches the licensee location.
Problem is, I can't work out how to reflect this in the query filter (see screenshot 2)
My licensee names match my event region names too, to make things clearer (see screenshot 3)
Q1) include all posts with the region set to "national" AND all posts where the taxonomy matches the licensee location.
You can edit each "national" post, enable all terms of taxonomy "event region", then filter the posts by the taxonomy "event region" by follow our document: https://toolset.com/documentation/user-guides/filtering-views-by-taxonomy/
Value set by URL parameter
Okay, I can pass the post title successfully as in screenshot 4 & 5.
How do I *also* include "National" posts? I tried as in screenshot 6 but it didn't show anything. I can't see how to add another taxonomy filter- or am I missing something?
I can see you are using a term "National" in taxonomy "event region", that's the problem, Views can not append the specific term "National" to the query when you filter by other term by default, so there is such a built-in feature within Views plugin, you can try one of below two workarounds:
1) same as I mentioned above: https://toolset.com/forums/topic/setting-up-taxonomy-filter-based-on-post-title/#post-574771
You can edit each "national" post one by one, enable all terms of taxonomy "event region"
2b) Sounds like what I need to do. What exactly would this query modification look like- and how would I limit it to just modify the "View Events on Licensee Page" view's query? I'm assuming I should be using wpv_filter_query, but the documentation for it hasn't helped me much.
Thank you for your reply. Luo is unavailable at moment, since this is an ongoing ticket, Luo will check your request and get back to you soon with more details. Just like to keep you updated.
For option 2), It is a custom PHP codes problem, if you need more assistance for it, please provide a test site with the same problem, and fill below private detail box with login details and ftp access, also point out the problem page URL and view URL, and where I can edit your PHP codes, I need a live website to test and debug. thanks
The SFTP access you provided is not valid, I can not see the website folder: application/public/
Please check it, also point out the problem page URL and view URL, and where I can edit your PHP codes, I need a live website to test and debug. thanks