Support » Everything else WordPress » wp_get_attachment_image_src returns false

  • Resolved FeliceAntonio


    Hi to everyone.
    Is a lot of time then I search to solve this issue, without results.
    I need to get the image URL in the post.
    I use this code:
    $Thumbnail = wp_get_attachment_image_src( get_post_thumbnail_id ($post->ID), 'full' );
    and $Thumbnail[0] returns nothing.
    I wonder why, I tried several options, but this should be correct to get the image URL, what I’m searching to do.
    The issue is in the Pinterest button: &media= nothing.

    The page I need help with: [log in to see the link]

Viewing 2 replies - 1 through 2 (of 2 total)
  • Moderator bcworkz


    Verify $post->ID has a valid value. Sometimes adding global $post; beforehand helps, or calling get_the_ID() instead.

    Thread Starter FeliceAntonio


    @bcworkz My issue was global $post missing.
    I found this code here to get the first image of the post.
    Thanks for your suggestion, it seems I solved!

Viewing 2 replies - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.