Support » Plugin: Pods - Custom Content Types and Fields » releaship between pods

  • Resolved madmikefrog



    Can anyone point me in the right direction. I get set up a pod, display all the fields, but when I try a relationship between a post and (Taxonomy). I can’t figure out to display the “related” fields. I have tried $pods->get_field (‘’) which is my related field. The demo video is great, but just I need an example code in version 2. I tried to figure from the early pod 1.x examples. but not getting anywhere. Any help is gratefully received

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Scott Kingsley Clark


    Please provide a little more information:

    • Post Type name
    • Taxonomy name
    • Relationship name on Post Type, that relates to taxonomy
    • Is this a relationship field, or are you using the built in taxonomy functionality?


    Label, Name,Object type,storage type
    houses, houses, Custom Post type, Meta
    typegardens ,typegardens,Custom Taxonomy,Table

    Label Label Name Field Types
    field1 home Plain Text
    field2 garden Relationship [type: pick] typegardens (Taxonomy)

    Label Label Name Field Types

    field1 gardentype Plain Text
    garden desc garden_desc Plain

    POD Page
    Page code
    $pods = new Pods(‘houses’);
    $pods->findRecords(‘name ASC’, 25);

    while ($pods->fetchRecord()) {
    echo $pods->get_field(‘home’);
    echo $pods->get_field(‘garden’);
    echo $pods->get_field( ‘typegardens.gardentype’ );
    echo $pods->get_field( ‘typegardens.garden_desc’ );

    Values in houses is;

    field1 (field1ofhouse)
    field2 drop down (typeofgarden1)

    value in gardentype is
    Name (typegardenfield1)

    field1 (field1gardentype)
    garden desc (field2gardendesc)

    Screen output is


    global $pods;
    if (empty($pods->data)) {
    $pods = 404; // Show standard WP 404 page if the item doesn’t exist
    $pods = new Pod(‘houses’);


    Hopefully that give you the information you need.



    Plugin Author Scott Kingsley Clark


    $garden = $pods->field( 'garden' );

    Plugin Author Scott Kingsley Clark


    You’ll also want to be sure you use PHP to loop through the array to output.

    Or you can use this and it will automatically output a list comma-separated for you:

    echo $pods->display( 'garden' );

    That’s help me out very nicely. Thanks for your time.


Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘releaship between pods’ is closed to new replies.