WordPess Pod plugin

    By enRaiser

    what is pods?
    The Pods Framework is a Content Development Framework for WordPress or we can say like CMS. You create and extend content types that can be used for any project. Add fields of various types we’ve built in, or add your own with custom inputs, you have total control.Pod is a wordpress plugin which enables you to add custom content type and their management to your wordpress installation.

    I’ll show you some of Pods Framework’s functionality by giving you a quick tutorial on how you we can use it to make a library site. The site will contain an overview page with all of the books we currently have, and when the user clicks on a book link he’ll see its details.
    You can also add taxonomy through the pod admin just follow the steps:-
    First of all you download the pod from the net. I am download the pod from here http://downloads.wordpress.org/plugin/pods.2.3.18.zip

    After downloading the podunzip that and put in your plugin folder.
    Then in site admin click on plugin right side on toolbar. you can see your pod is display but still not activate check this and activate it.
    After activate you see the pods Admin in your toolbar.

    1. Click on Pods Admin-> add new->Create new.
    2. In content type select custom post type and write the name of post then click on Next step.
    3. In pods Admin you will see the your taxonomy is created with your name and content type(Custom Taxonomy).
    4. Click on the edit to add the fields in your pod (we can also delete the taxnomy from here).
    5. Then click on ‘Add Field’ button to add your fields.
    6. Write our Field Name, Description and field type(from the drop down menu).
    7. Options is the require or not. If you check that checkbox then that field make complsurry, without adding that field you can’t save the details.
    8. After adding all that detail thaN click on ‘Add Field’ button to add and cancel to cancel that.
    9. After adding all the fields in that don’t forget to click on ‘save pod’ button on left side.
    10. You can check out other tabs (Labels, Admin UI, Advance Option) for more knoledge.
    11. Afetr save pod you can see your pod is display on the left side on the toolbar now you add the data that you need to display on the client side.


    I have a pod setup:

    pod: Books
    Name: books
    Type: Custom
    Storage type: Table

    1: Name: Author
    Field type: Relationship authors(author) (Custom)

    2: Name: Image
    Field type: File / Image / Video (custom)

    pod: Authors
    Name: Authors
    Type: Custom
    Storage Type: Table

    1: Name: Birth Date
    Field Type: Date

    2: Name: Date of Death
    Field Type: Date

    3: Name: Occupation
    Fiels Type: Plain Text

    4: Name: Image
    Field Type : File / Image / Video

    5: Name : Book
    Field type: Relationship Books(book)

    pod: Subject
    Name: Subject
    Type: Texonomy


    How to relate pod-post and pod-texonomy?


    what is pod Relation and how to create it?
    A Relationship column is essentially a select list containing items from the related type.
    As i create in my pod column “book” pod that relates to another pod “author”, then in the edit form for book you’ll see a select list with all event items

    To create Relation just follow the steps:-
    1. click on pods admin on right side on toolbar and then edit your pod and select your field to make it Relation field.
    2. Then Edit that field and just select field type of that is “Relationship” from dropdown menu that add another option Related-To select it same pod field.
    3. Bi-directional select another field to relat to that.
    4. Same steps follow for another pod.

    The following code will retrive the related field:

    $pod = pods(‘podplus’, get_the_ID());
    $params = array(
    “WHERE” => “authors.post_title = ‘some_name'”

    $related = $pod->find( $params );


    Converting objects from wordpress to pod and vise-versa.
    get pod object for one id

    $var1= new Pod(‘pod_name’);

    echo $var1->display(‘field_name’);

    what kind of query are supported.

    1. $var = array( ‘limit’ => -1, ‘where’ => “field_name.meta_value =’$some_value'”);
    2. $var = array( ‘limit’ => -1, ‘where’ => “t.field_name =’$some_value'”);
    3. $var = array( ‘limit’ => -1, ‘where’ => “pod_name.name =’$some_value'”);
    for ex.

    4. $var = array( ‘limit’ => -1, ‘where’ => “field_name.ID =’$some_value'”);

    The third one is for custom texonomy.
    The fourth one is for the relation field

    -1 is indicate that infinite loop.

    get_field Use.
    This is a very versatile function. we can use to store the value, echo a value and interact with a value. And note the type of variable returned is relative to the field type.
    For Ex. A repeater will return a multidimensional array.

    <?php $field = get_field($field_name, $post_id, $format_value); ?>

    $field_name: the name of the field to be retrieved. eg “page_content” (required)
    $post_id: Specific post ID where your value was entered. Defaults to current post ID (not required). This can also be options / taxonomies / users / etc
    $format_value: whether or not to format the value loaded from the db. Defaults to false (not required).