To illustrate – this is the code we are using to pull out images from the post and display in the appropriate section on the front page (note, I’m using a plugin called ‘excerpt re-reloaded’ to control the excerpt length depending on whether there is an image or not.
Is there a way to pull up a single the same way? :
$args = array(
‘numberposts’ => 1,
‘post_type’ => ‘attachment’,
‘status’ => ‘publish’,
‘post_mime_type’ => ‘image’,
‘post_parent’ => $post->ID
);
$images = &get_children($args);
//start if/else
if($images) {
foreach ( (array) $images as $attachment_id => $attachment ) { ?>
<a href="” rel=”bookmark” title=”">
<?php the_excerpt_rereloaded('55','','‘,’div’,'yes’); ?>
<?php the_excerpt_rereloaded('90','…','‘,’div’,'yes’); ?>
}
?>