WordPress.org

Ready to get started?Download WordPress

Forums

Pods - Custom Content Types and Fields
[resolved] Dispaly Images (10 posts)

  1. benclintz
    Member
    Posted 1 year ago #

    How do i display the first image in my post in pods? i have tried several methods but they dont work

    http://wordpress.org/extend/plugins/pods/

  2. Scott Kingsley Clark
    Member
    Plugin Author

    Posted 1 year ago #

    Is this in PHP or are you using a shortcode? Or is this a Pod template?

  3. benclintz
    Member
    Posted 1 year ago #

    this is in the pod template that i am creating. i want to display the title, excerpt and pull the first image and probably resize it as well

  4. Scott Kingsley Clark
    Member
    Plugin Author

    Posted 1 year ago #

    One more question, is this a Custom Post Type or an Advanced Content Type?

  5. benclintz
    Member
    Posted 1 year ago #

    it is a custom post type. (like post or pages)

  6. Scott Kingsley Clark
    Member
    Plugin Author

    Posted 1 year ago #

    You should be using theming for outputting this, take a look at:

    http://codex.wordpress.org/Template_Hierarchy

    and these:

    http://codex.wordpress.org/The_Loop
    http://codex.wordpress.org/The_Loop_in_Action

    You would use the_title() and get_post_meta() for custom fields

    http://codex.wordpress.org/Function_Reference/get_post_meta

  7. benclintz
    Member
    Posted 1 year ago #

    could you kindly give me an example. Iam quite new to php i have already figured out how to call the title and the xcerpt. its just that i am having a problem with calling the post image

  8. Scott Kingsley Clark
    Member
    Plugin Author

    Posted 1 year ago #

    You could try this:

    http://codex.wordpress.org/Function_Reference/the_post_thumbnail

    OR if this is a image upload field in your Pod, you could use this:

    echo pods_image( get_post_meta( get_the_ID(), 'your_image_field_name', true ), 'thumbnail' );

    Also related:

    http://codex.wordpress.org/Function_Reference/wp_get_attachment_image

  9. benclintz
    Member
    Posted 1 year ago #

    Thanks Scott. I really appreciate your help
    i have tried

    <h4><a href="{@permalink}">{@post_title}</a></h4>
    <div>
    <?php
    if ( has_post_thumbnail() ) { // check if the post has a Post Thumbnail assigned to it.
      the_post_thumbnail();
    }
    ?>
    </div>
    <div>{@summary}
        <a href="{@permalink}">Read More</a>
        <hr />
    </div>

    [Please post code & markup between backticks or use the code button. Your posted code may now have been permanently damaged by the forum's parser.]

    the title and summary/excerpt are ok but i am still having a problem with the image (which happens to be in the post)

  10. Scott Kingsley Clark
    Member
    Plugin Author

    Posted 1 year ago #

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.