wp_get_attachment_image_src [ WordPress Function ]
wp_get_attachment_image_src ( $attachment_id, $size = 'thumbnail', $icon = false )
| Parameters: |
|
| Returns: |
|
| Defined at: |
|
Soorgelijke functies: wp_get_attachment_image, get_attachment_icon_src, wp_get_attachment_url, wp_get_attachment_link, wp_get_attachment_thumb_url
Retrieve an image to represent an attachment.
A mime icon for files, thumbnail or intermediate size for images.
Source
<?php
function wp_get_attachment_image_src($attachment_id, $size='thumbnail', $icon = false) {
// get a thumbnail or intermediate image if there is one
if ( $image = image_downsize($attachment_id, $size) )
return $image;
$src = false;
if ( $icon && $src = wp_mime_type_icon($attachment_id) ) {
$icon_dir = apply_filters( 'icon_dir', ABSPATH . WPINC . '/images/crystal' );
$src_file = $icon_dir . '/' . wp_basename($src);
@list($width, $height) = getimagesize($src_file);
}
if ( $src && $width && $height )
return array( $src, $width, $height );
return false;
}
?>
Examples [ wp-snippets.com ]
Top Google zoekresultaten
- Function Reference/wp get attachment image src « WordPress Codex
Description. Returns an array with the image attributes "url", "width" and "height", of an image attachment file. Note: For just the image src, use the first element in ...
codex.wordpress.org - wp_get_attachment_image_src | Will Ayers
Tag Archives: wp_get_attachment_image_src. WordPress: Get Url Of Featured Image. Posted on April 28, 2011 by cointilt · Reply. There is a very easy way to ...
cointilt.me - gallery - Optimizing wp_get_attachment_image_src - WordPress
Apr 17, 2012 ... foreach($slideshow_data['attachment_ids'] as $attachment_id) { $img_data = wp_get_attachment_image_src( $attachment_id, 'full' ); echo ...
wordpress.stackexchange.com - Timthumb, MaxCDN, W3 Total Cache, wp_get_attachment_image_src
Mar 27, 2012 ... Timthumb is a great piece of software used by many theme designers for thumbnail generation and manipulation. It does an excellent job ...
wordpress-tips.info
Gebruikersdiscussies [ wordpress.org ]
- jfeaver on "Images automatically cropped to square"
- touchy finger on "wp_get_attachment_image_src problem"
- petershep on "wp_get_attachment_image_src problem"
- hootenanny1 on "wp_get_attachment_image_src ignores size parameter [x-post]"
- hootenanny1 on "wp_get_attachment_image_src ignores size parameter [x-post]"
- helgatheviking on "post_thumbnail producing wp-includes/images/crystal/default.png"
- alchymyth on "post_thumbnail producing wp-includes/images/crystal/default.png"
- helgatheviking on "post_thumbnail producing wp-includes/images/crystal/default.png"
- helgatheviking on "post_thumbnail producing wp-includes/images/crystal/default.png"
- alchymyth on "post_thumbnail producing wp-includes/images/crystal/default.png"