WordPress.org

Ready to get started?Download WordPress

Forums

wp_get_attachment_image isn't returning thumbnail (2 posts)

  1. michael.mariart
    Member
    Posted 2 years ago #

    I'm trying to get the thumbnail of attachments in my script, but no matter what I do, the result from wp_get_attachment_image() returns the full-sized image.

    I'm calling this by:
    echo wp_get_attachment_image ($render->ID, "thumbnail");
    Where $render is an attachment with these details:

    stdClass::__set_state(array(
       'ID' => 564,
       'post_author' => '2',
       'post_date' => '2012-02-23 03:34:25',
       'post_date_gmt' => '2012-02-23 03:34:25',
       'post_content' => '',
       'post_title' => '3D render image',
       'post_excerpt' => '',
       'post_status' => 'inherit',
       'comment_status' => 'closed',
       'ping_status' => 'closed',
       'post_password' => '',
       'post_name' => '3d-render-image-7',
       'to_ping' => '',
       'pinged' => '',
       'post_modified' => '2012-02-23 03:34:25',
       'post_modified_gmt' => '2012-02-23 03:34:25',
       'post_content_filtered' => '',
       'post_parent' => 0,
       'guid' => '',
       'menu_order' => 0,
       'post_type' => 'attachment',
       'post_mime_type' => 'image/jpeg',
       'comment_count' => '0',
       'ancestors' =>
      array (
      ),
       'filter' => 'raw',
    ))

    I've also checked and all of the resized images exist and are able to be seen.

    The only thing that I cna think of is that I create these attachments using the wp_insert_attachment() function but I though that was what should be used for inserting attachments???

    Am I doing something wrong, or is there some other reason that I can't get the thumbnail image?

  2. MikeHarris
    Member
    Posted 1 year ago #

    Hi, I've got the same issue with WP 3.4.2 - did you ever find out what the issue was? Thanks, Mike

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.