WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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 ?

share|improve this question
up vote 1 down vote accepted

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

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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