Thanks for this info! Also, in reply to an above question, you could restrict it based on category using the WP conditional:
<?php
if ( in_category( ‘your_category’ )) {
YOUR CODE
}
?>
So, for example:
<?php
if ( in_category( 'your_category' )) {
$args = array(
'post_type' => 'attachment',
'numberposts' => null,
'post_status' => null,
'post_parent' => $post->ID
);
$attachments = get_posts($args);
if ($attachments) {
foreach ($attachments as $attachment) {
echo wp_get_attachment_image($attachment->ID, 'medium');
}
}
}
?>