Código PHP:
<?php query_posts('cat=1'); ?>
<?php if ( have_posts() ) while ( have_posts() ) : the_post(); ?>
<?php
$args = array(
'post_type' => 'attachment',
'post_mime_type' => 'image',
'numberposts' => -1,
'order' => 'ASC',
'post_status' => null,
'post_parent' => $post->ID
);
$attachments = get_posts($args);
if ($attachments) {
foreach ($attachments as $attachment) {
$image = wp_get_attachment_image_src( $attachment->ID );
$miniatura= '<img src="'.$image[0].'" width="'.$image[1].'" height="'.$image[2].'" alt="'.get_the_title().'" title="'.get_the_title().'" />';
break;
}
}
?>
<a href="AQUI TENGO QUE SACAR LA IMAGEN EN GRANDE"><?php echo($miniatura); ?></a>
<?php endwhile; ?>