I'm trying to integrate a custom slider using a 3rdParty jQuery plugin onto the homepage.

I'm almost there. I need the original featured images and not the cropped ones.

<?php if (is_home()): ?>
$featured_posts = new WP_Query(array(
    'post_type' => 'post',
    'showposts' => 5,
    'tag' => 'featured'
<?php while($featured_posts->have_posts()): $featured_posts->the_post(); ?>
    <?php $image = wp_get_attachment_image_src(get_post_thumbnail_id($post->ID), 'featured-image'); ?>                        
    <a href='<?php the_permalink(); ?>'>
        <img src="<?php echo $image[0]; ?>" style="width:940px;height:500px" />
<?php endwhile; ?>                    
<?php endif ?>                

The problem here is that all the images are of 516x340 dimension. How I get the original dimensioned image ?

1 Answer 1


The second parameter for wp_get_attachment_image_src is $size.

(string/array) (optional) Size of the image shown for an image attachment: either a string keyword (thumbnail, medium, large or full) or a 2-item array representing width and height in pixels, e.g. array(32,32). As of Version 2.5, this parameter does not affect the size of media icons, which are always shown at their original size.


Per that Codex entry $size can take string values of "thumbnail, medium, large or full". You need "full" to get the full size image, which ought to be the original.

It seems to me like you could save yourself a little bit of trouble with wp_get_attachment_image instead of wp_get_attachment_image_src

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.