Support

Account

Home Forums General Issues Use URL queries to filter the taxonomy of a relationship field

Unread

Use URL queries to filter the taxonomy of a relationship field

  • Hi there,

    I have a site with a number of CTPs. One is called “Showing” (a unique session for a musical). The other is called “Venue“, which also has it’s own custom hierarchical taxonomy (Country > State > City). Each Showing uses an ACF Relationship field to select a Venue.

    Basically what I want to do is pass a URL parameter when in the archive of Showings (e.g: mysite.com/showings?country=france&city=paris) to display all those whose related Venue CTP has those taxonomies assigned.

    If possible, I’d love to read/rewrite URLs in a format more like mysite.com/showings/france/ile-de-france/paris (as well as redirect to this any queries that come back with a singular child category, such as mysite.com/showings/paris).

    I have no code yet as this was a bit out of my depths to start but I’m hoping someone might be able to point me in the right direction – I’m imagining a combo of get_query_var and WP_Query?

    Thank you in advance for your kind advice!

Viewing 1 post (of 1 total)

The topic ‘Use URL queries to filter the taxonomy of a relationship field’ is closed to new replies.