New Thumbnail function and Facebook (2 posts)

  1. Justin Cline
    Posted 6 years ago #

    Any ninjas out there know if it's possible to get just the src from one of the new get_the_post_thumbnail functions? I want to take that and dump it into the header, so when a post is shared on Facebook, it specifies the post's thumbnail.


  2. Mark / t31os

    Posted 6 years ago #

    Yeah sure it's possible...

    Although i'd personally suggest using get_post_thumbnail_id to get the ID for the thumbnail, then use wp_get_attachment_url to get the URL..

    Something like..

    $myvar = wp_get_attachment_url( get_post_thumbnail_id() );


    get_post_thumbnail_id doesn't seem to have a codex page, so hence the lack of linkage for that one.. i was simply looking here ..

Topic Closed

This topic has been closed to new replies.

About this Topic