query( 'order=DESC&caller_get_posts=1' );
while ($mod_slide->have_posts()) : $mod_slide->the_post();
// Check to see if the posts have attachments.
$attachments = get_children(array('post_parent' => get_the_ID(), 'post_type' => 'attachment', 'post_mime_type' => 'image', 'orderby' => 'menu_order'));
if ( empty( $attachments ) )
continue;
// Set our attachment variable.
$first_attachment = '';
// Awesome! We have attachments! Let's grab the first one that's 950px x 425px.
foreach ( $attachments as $attachment ) {
$image = wp_get_attachment_image_src( $attachment->ID, 'modularity-slideshow' );
if ( $image[1] >= 950 && $image[2] >= 425 ) {
$first_attachment = $attachment;
break;
}
}
// Cool. Now, if we actually have an attachment, let's pop it into our slideshow.
if ( $first_attachment != '' ) { ?>