I'm trying to display posts with an attachment image. I can display the posts, but the image attachment isn't working. Here's what I've got so far:
<?php
$attachments = get_children(array('post_parent' => get_the_ID(), 'post_type' => 'attachment', 'post_mime_type' => 'image', 'orderby' => 'menu_order'));
if ( ! is_array($attachments) ) continue;
$count = count($attachments);
$first_attachment = array_shift($attachments);
?>
<?php echo wp_get_attachment_image($first_attachment->ID); ?>
I think it's in the wp_get_attachment_image part, but not sure what I'm doing wrong. Thanks to anyone who can shed some light!