• Resolved becca37

    (@becca37)


    I have a dogs Custom Post Type pod. In that pod are three (relevant) bi-directional relationship fields to a litters Custom Post Type pod:

    • breedings-as-sire
    • breedings-as-dam
    • from-litter

    So now I’m making pages listing dogs with this or that, and would like a page each showing all dams, sires, and puppies.

    I’m stuck on creating the where clause for the pod params array. example:

    
    $dogParams = array( 'limit' => $limitPerPage
    	, 'orderby' => $aOrderBy
    	, 'where' => "breedings-as-dam [what-to-put-here-to-limit-to-dogs-that-are-dams-in-1-or-more-litters?]");
    $dogs = pods( 'dogs', $dogParams );
    

    I’ve tried

    , 'where' => "breedings-as-dam IS NOT NULL" ==> gives me every dog back

    , 'where' => "ISNULL(breedings-as-dam,'') <> ''" ==> gives me error text which is missing the ‘<>’ portion

    , 'where' => "ISNULL(breedings-as-dam,'') != ''" ==> gives me error text say8ing the ‘!=’ is not valid

    I suspect I might be barking {hehhehheh} up the wrong tree here. Could you point me in the right direction?

Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Find Pod entries Where Relationship Field Has Been Linked’ is closed to new replies.