0

Hi i am using the normal loop to get the post content. Objective is to show images or videos in the blog.

I tried the_content() for the loop but am getting the thumbnail image i belive, What i want is the original image should be there.

Here is the code

<?php if ( have_posts() ) :
              while ( have_posts() ) : the_post();
                   the_content();//by this am getting the medium sized images from the post content as it is uploaded through add media
              endwhile;
              endif;
        ?>

Now i want to show full size of the image for each post. How to do it.

can anybody help?

2 Answers 2

3

Since you say that your image is "uploaded through add media", you need to select the full sized image when you attach it to the post, not when you try to display it. You should even see in the markup that a smaller size has been chosen (by you).

Look over on the right side in the sidebar toward the bottom. You should see a dropdown that will let you choose "size".

4
  • 1
    Thanks for the info. I didn't noticed for the past one month. This will be appropriate for me by this using the_content() alone i can able to show video as well as images without any conditional statement in my loop. +1 @s_ha_dum
    – rram
    Commented Dec 15, 2013 at 15:54
  • If you have anything to say. Just say:)
    – rram
    Commented Dec 15, 2013 at 15:56
  • Hi i have one doubt, Can i make pagination from this loop or should i use wp_query object then make pagination. Which is possible if you let me know this i'll ask a separate question based on that. Thanks @s_ha_dum
    – rram
    Commented Dec 16, 2013 at 18:29
  • You can paginate any Loop, but how you do it depends on context.
    – s_ha_dum
    Commented Dec 16, 2013 at 19:04
1

This outputs the Post Thumbnail/Featured Image in full size:

<?php
    if ( has_post_thumbnail())
    {
      $full = wp_get_attachment_image_src( get_post_thumbnail_id( get_the_ID() ), 'full' );
      echo '<img src="' . $full[0] . '">';
    } else {
      echo 'No post thumbnail.';
    }
  ?>
1
  • 1
    Thanks for the code i'll try to use whenever i need this knowledge. +1 @luke
    – rram
    Commented Dec 15, 2013 at 15:55

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.