Back to Tips & Tricks

Process of creating a link within a post that filters content based on two criteria

Felipe SelfenePublished on Updated

It seems like you're describing a process of creating a link within a post that filters content based on two criteria: the subdivision (comuna) and the post type. The link is constructed using a dynamic widget to capture the comuna type, and manually adding the post type. The structure of the link before and after the modification is explained, and there's a mention of the option to filter only by the parent subdivision (comuna) using a query and a post listing.

Before: https:/web.cl/turismo/filtro/comuna-turismo:

"here goes the dynamic comuna ID"

After: ;tipo-turismo:122/

https:/web.cl/turismo/filtro/comuna-turismo:  "here goes the dynamic comuna ID" After: ;tipo-turismo:122/

If you only need it to filter by the parent subdivision, you should use a query and add a post listing to display only the parent subdivisions.

Frequently Asked Questions

How do you build a link that filters content by two criteria?
The link filters by the subdivision (comuna) and the post type. A dynamic widget captures the comuna value, and the post type is added manually to the end of the link.
What does the filter link look like before and after the change?
Before, the link ends with comuna-turismo: followed by the dynamic comuna ID. After, ;tipo-turismo:122/ is appended to that ID, so the two filters are separated by a semicolon.
How do you add the post type to the link?
It is typed by hand after the dynamic comuna ID. In the article's example the appended part is ;tipo-turismo:122/, including the leading semicolon.
What if I only need to filter by the parent subdivision?
Use a query and add a post listing that displays only the parent subdivisions.

Related tips