Skip Navigation

[Resolved] Limit filters based on a post terms

This support ticket is created 4 years, 9 months ago. 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.

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

Supporter timezone: America/Jamaica (GMT-05:00)

Tagged: 

This topic contains 4 replies, has 2 voices.

Last updated by Shane 4 years, 9 months ago.

Assisted by: Shane.

Author
Posts
#1575795

Hi,
I have a custom post template displaying a "related posts" dynamic view.
The view must display :
1- a filter with a checkbox for each term of the current post ;
2- a list of all posts having at least one common term with the current post.
What would be the best way to build this with Views ?
Thank you.

#1576121

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Screenshot 2020-04-06 at 2.20.05 PM.png

Hi Roman,

Thank you for getting in touch.
This is actually possible to do. Assuming that you've already created your view, please follow the instructions below:

  • Add a query filter to view for your Taxonomy. See Screenshot
  • Once you've done this you just need to set the filter to "Set by the Page where this View is shown"
  • Finally just add the view to the page where you want it to show the related content.

Please let me know if this helps.
Thanks,
Shane

#1576205

Hello and thank you,
I didn't know this was doable !
Nevertheless, I've tried it here but it didn't work : hidden link
The query keeps display ALL terms of ALL taxonomies..
Thank you.

#1576227

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Roman,

Would you mind providing me with admin access to the website so that I can have a more detailed look at this one for you ?

The private fields will be enabled for your next response.

Thanks,
Shane

#1576279

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Roman,

Ok so now I have a full understanding of the situation.

You also want the view frontend filters to also function so that you can filter through the posts on the frontend by the same taxonomies?

If so then it won't be possible to have the frontend filters working while having those same filter parameters be filtering by the current post.

You can only do one at a time. Currently my advise would've made you set your filters to filter the view by the current page that it is on.

So in summary you can't have both at the same time. If you're having your view filtered by the current page and still want to have the frontend filters then you need to filter your view by other parameters than these taxonomies.

Thanks,
Shane