I made a separate wordpress page to display all of my featured images and they do display but I need help on how to make them display to their actual size not as really small images.
<?php
$the_query = new WP_Query();
$the_query->query("cat=4&nopaging=true");
if ($the_query->have_posts()) :
while($the_query->have_posts()) : $the_query->the_post();
if(has_post_thumbnail()) :
the_post_thumbnail();
endif;
endwhile;
endif;
wp_reset_postdata();
$image = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'single-post-thumbnail' );
?>
<img src='<?php echo $image[0]; ?>' />
That is my code right now the page is http://rickwarren.veracitycolab.com/banners/
Thanks!
This is what my new code looks like and the images are still the same any thoughts?
<?php
$the_query = new WP_Query();
$the_query->query("cat=4&nopaging=true");
if ($the_query->have_posts()) :
while($the_query->have_posts()) : $the_query->the_post();
if(has_post_thumbnail()) :
the_post_thumbnail();
endif;
endwhile;
endif;
wp_reset_postdata();
$image = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'full' );
?>
If it still hasn’t changed after you’ve added the ‘full’ parameter you might want to try
the Regenerate Thumbnails plugin:
http://wordpress.org/extend/plugins/regenerate-thumbnails/
Usually it helps for me when I’ve been messing around with custom thumbnail sizes.
Pass
wp_get_attachment_image_src(...)
a size parameter as well. In your case, you want ‘full’, sowp_get_attachment_image_src( $post->ID, 'full' )
. From the Codex for that function:CSS rules could still ‘shrink’ the image though, so if it doesn’t work check the URL in the HTML source to confirm that the correct image is being requested, then check the stylesheet.
The second argument of wp_get_attachment_image_src() is the size of the image to return. Using
full
here should give you the full size image.EDIT: Of course this part of your code isn’t doing anything since it’s outside the loop.
Change line 8 to
the_post_thumbnail('full');
You can delete everything after the line that begins with
$image...
. Codex page here