Support

Account

Home Forums General Issues Use url parameters to sort results of relational field query

Unread

Use url parameters to sort results of relational field query

    • Justin

    • September 26, 2020 at 1:45 am

    Background:
    The goal is to use query parameters to filter results of a relationship field by a custom taxonomy using a select dropdown, which is populated with that custom taxonomy from the posts that have been selected from the relationship field.

    Problem:

    I have a relational field that comprising of posts from a Product custom post type. On the page where these results are displayed, I have a dropdown selection that pulls the custom taxonomy, named product-tag, from these Products and that populates the dropdown selections. The user selects the product tag from the dropdown and I want to filter the results by a query parameter, like this: website.com/?product-tag=tagName. I’ve tried a variety of approaches, building off of this tutorial https://www.advancedcustomfields.com/resources/creating-wp-archive-custom-field-filter/. But the difference here is I’m not filtering posts from the main query, but instead from a custom field relationship query – and I can’t seem to get that to work.

    Appreciate any direction. Thanks!

Viewing 1 post (of 1 total)

You must be logged in to reply to this topic.

We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Cookie Policy. If you continue to use this site, you consent to our use of cookies.