• Resolved brutoblo99

    (@brutoblo99)


    Search for a pod that has a spedicif value in a relationship field.

    I have extended the “post” pod, just added a relationship field to another pod (Custom Post Type) called “Cities”

    I have another pod with a lot of fields etc: let’s call it “Events”.
    The “Events” pod also has a relationship field to “Cities”.

    Now, in a specific event page, I wanto to show all posts that are related do the same city of that event.

    I was thinking of doing something like this:

    $id_city=get_the_id();
    $params = array(
        'orderby' => 't.name DESC',
        'limit' => 15,
        'where' => '??????'
        );
    $posts_pod = pods( 'post', $params );

    as you can see, i don’t know what to put in the “where” clause…

    https://www.ads-software.com/plugins/pods/

Viewing 1 replies (of 1 total)
  • Thread Starter brutoblo99

    (@brutoblo99)

    Got it!

    Just in case someboby else will struggle with this:

    $params = array(
    	'limit' => 15,
    	'where' => 'cities.id='.$id_city
    );
Viewing 1 replies (of 1 total)
  • The topic ‘Search for a pod that has a spedicif value in a relationship field’ is closed to new replies.