WordPress.org

Ready to get started?Download WordPress

Forums

wp_get_attachment_image_src ignores size parameter (1 post)

  1. hootenanny1
    Member
    Posted 3 years ago #

    I'm using wp_get_attachment_image_src to display images that I've uploaded and attached to the current post using the media section of the wp-admin backend.

    According to the Codex for the size parameter I can provide an array with width and height, however the function does not create an image with these parameters, but rather selects which ever one of the standard sizes (thumb, medium, large, full) fits my dimensions the closest.

    Can anyone help? Thanks a lot.

    Here's the code I'm using within the loop:

    <?php $images =& get_children( 'post_type=attachment&post_mime_type=image&numberposts=1&post_parent='.get_the_id() );
    				foreach( $images as $image => $image_object) {
    					$image_full = wp_get_attachment_image_src($image_object->ID, array( 569, 10));
    					$image_thumb = wp_get_attachment_image_src($image_object->ID, array( 71, 40));
    				}?>

Topic Closed

This topic has been closed to new replies.

About this Topic