[wp-hackers] the_post_thumbnail 'full' with no width/height attr
John Blackbourn
johnbillion+wp at gmail.com
Wed Feb 16 19:26:04 UTC 2011
On 16 February 2011 18:45, Kevin Newman <CaptainN at unfocus.com> wrote:
> Which would be less likely to break?
The method least likely to break would be using the attachment
functions rather than meta fields directly. From within the loop:
$thumb = wp_get_attachment_image_src( get_post_thumbnail_id(), $size );
$thumb will then be an array of elements the source, width, and height
respectively. To output the src you'd just use:
echo $thumb[0];
John
More information about the wp-hackers
mailing list