Title: Shortcode Filter Where In
Last modified: December 2, 2019

---

# Shortcode Filter Where In

 *  Resolved [7thmin](https://wordpress.org/support/users/7thmin/)
 * (@7thmin)
 * [6 years, 6 months ago](https://wordpress.org/support/topic/shortcode-filter-where-in/)
 * I have 3 pods: Channel, Game and Tournament.
 * Channel and Tournament are linked with a relationship field with multiple option(
   meaning a Tournament can be on several channels and a channel can have several
   tournaments).
 * Game and Tournament are linked similarly.
 * In a Pods template for Games (i.e. an individual game within a tournament) – 
   I want to display which channels are showing games for that Tournament. i.e.
 * Game A is Part of Tournament 1
    Tournament 1 is Shown on Channels 3 & 4 Return
   Channel 3 & Channel 4.
 * [pods name=”Channels” where=”Game.Tournament.meta_value IN ({@Channels.Tournaments})”
   template=”templatePod”]
 * The issue seems to be with the fact I’m trying to search in an array. Can someone
   please clarify the right way to approach this?

Viewing 3 replies - 1 through 3 (of 3 total)

 *  Plugin Author [Jory Hogeveen](https://wordpress.org/support/users/keraweb/)
 * (@keraweb)
 * [6 years, 6 months ago](https://wordpress.org/support/topic/shortcode-filter-where-in/#post-12197268)
 * Hi [@7thmin](https://wordpress.org/support/users/7thmin/)
 * You will have to make sure the `where` parameter has the correct syntax for SQL.
   
   You could use the output display filters to make sure the syntax is correct, 
   more info: [https://docs.pods.io/displaying-pods/magic-tags/display-filters-with-magic-tags/#Using_Functions_On_Field_Output](https://docs.pods.io/displaying-pods/magic-tags/display-filters-with-magic-tags/#Using_Functions_On_Field_Output)
   You can use the plugin Query Monitor to validate the query.
 * Personally I think you are better off working with actual PHP templates for such
   cases. These are edge case usages for the shortcodes / magic tags and not really
   what it’s meant for (even if you could get it working).
 * Cheers, Jory
 *  Thread Starter [7thmin](https://wordpress.org/support/users/7thmin/)
 * (@7thmin)
 * [6 years, 6 months ago](https://wordpress.org/support/topic/shortcode-filter-where-in/#post-12199787)
 * Thanks [@keraweb](https://wordpress.org/support/users/keraweb/),
 * I couldn’t understand the display filters link i’m afraid.
 * The plugin has really helped me understand a little better where its going wrong
   and can articulate a little better. Basically what i’m trying to do is say:
 *     ```
       This is a game -> This game is in this tournament (relationship field) -> Get the Tournament
   
       Channels have tournaments (relationship field) -> Which Channels have this tournament -> Here are all channels that have this Tournament
   
       List all channels in a template.
       ```
   
 * I think part of the problem here is that there is no direct relationship between
   the Game and the Channel, and that i’m trying to use Tournament, which has relationships
   with both, as a sort of bridge.
 * I only know a little PHP so is there any way you can envision this working in
   the Shortcode?
 *  Thread Starter [7thmin](https://wordpress.org/support/users/7thmin/)
 * (@7thmin)
 * [6 years, 6 months ago](https://wordpress.org/support/topic/shortcode-filter-where-in/#post-12199871)
 * Occums Razor… resolved:
 * [pods name=”Channels” where=”Tournament.ID IN (ID)” template=”templatePod”]

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Shortcode Filter Where In’ is closed to new replies.

 * ![](https://ps.w.org/pods/assets/icon.svg?rev=3286397)
 * [Pods - Custom Content Types and Fields](https://wordpress.org/plugins/pods/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/pods/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/pods/)
 * [Active Topics](https://wordpress.org/support/plugin/pods/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/pods/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/pods/reviews/)

## Tags

 * [shortcode](https://wordpress.org/support/topic-tag/shortcode/)
 * [where clause](https://wordpress.org/support/topic-tag/where-clause/)

 * 3 replies
 * 2 participants
 * Last reply from: [7thmin](https://wordpress.org/support/users/7thmin/)
 * Last activity: [6 years, 6 months ago](https://wordpress.org/support/topic/shortcode-filter-where-in/#post-12199871)
 * Status: resolved