[wp-trac] [WordPress Trac] #11571: Provide easy way to return url of thumbnail image
WordPress Trac
wp-trac at lists.automattic.com
Fri Sep 2 20:58:26 UTC 2011
#11571: Provide easy way to return url of thumbnail image
-------------------------------------------------+-------------------------
Reporter: braindrain | Owner:
Type: enhancement | Status: new
Priority: normal | Milestone: Future
Component: Post Thumbnails | Release
Severity: normal | Version: 2.9
Keywords: 3.2-early has-patch needs-testing | Resolution:
gsoc |
-------------------------------------------------+-------------------------
Comment (by downstairsdev):
+1 For @leewillis77's patch. Tested in the loop with image size and
without image size.
I am wondering if we should also have the companion function for output in
the loop, or if that's overkill:
{{{
/**
* Display The Post Thumbnail Source
*
*
* @param int $size Optional. Image size. Defaults to 'post-thumbnail',
which theme sets using set_post_thumbnail_src( $width, $height, $crop_flag
);.
* @param string|array $attr Optional. Query string or array of
attributes.
*/
function the_post_thumbnail_src( $size = 'post-thumbnail', $attr = '' ) {
echo get_the_post_thumbnail_src( null, $size, $attr );
}
}}}
BTW: My use case is for a responsive portfolio layout. If images have
height/width attributes they scale badly with min-width:100% in CSS.
--
Ticket URL: <http://core.trac.wordpress.org/ticket/11571#comment:11>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list