I've been trying to get the featured image of a post to be displayed outside of the loop for all the image thumbnails. That way, the featured image (of a product) is displayed in large and the thumbnails just below it. All the images in the (product) post are set in their own gallery of images.
Please see comment in code- the place where I'm trying to get the featured image to be displayed.
I'm sure I'm just missing something easy! Thanks!!
if (themedy_get_option('product_gallery')) { add_action('genesis_post_content', 'themedy_product_images', 1); }
function themedy_product_images() { ?>
<?php
global $post;
$images = get_children( array( 'post_parent' => $post->ID, 'post_type' => 'attachment', 'post_mime_type' => 'image', 'numberposts' => 999, 'order'=> 'ASC', 'orderby' => 'menu_order' ) );
if ( $images ) { ?>
<div class="twocol-one">
<?php
//How do I insert the featured image of the post over here
?>
<div class="product_images">
<div class="container">
<?php
foreach ( $images as $image ){
$gallery_image_info = wp_get_attachment_image_src( $image->ID, 'full' );
$gallery_image = $gallery_image_info[0];
$gallery_thumb_info = wp_get_attachment_image_src( $image->ID, 'Gallery Thumb' );
$gallery_thumb = $gallery_thumb_info[0];
$gallery_image_alt = get_post_meta($image->ID, '_wp_attachment_image_alt', true) ? trim(strip_tags( get_post_meta($image->ID, '_wp_attachment_image_alt', true) )) : trim(strip_tags( $image->post_title ));
echo '<a href="'.$gallery_image.'" title="'.$gallery_image_alt.'" class="fancybox" rel="single-gallery"><img src="' . $gallery_thumb . '" /></a>';
}
?>
</div>
</div>
</div>
If I use:
<?php the_post_thumbnail(); ?>
It Outputs:
<img width="1125" height="1500" title="6593_front" alt="6593_front" class="attachment-post-thumbnail wp-post-image" src="..../wp-content/uploads/2011/12/6593_front.jpg">
The image is way too big :( I need it to output with the following class..
class="alignnone size-large wp-image-6593"