I have the following function, it displays the attachments of a post, however it shows the full size, how can i show a limited number of attachments and also a smaller version like a thumbnail.
function page_thumbnails() {
$argsThumb = array(
'order' => 'DESC',
'post_type' => 'attachment',
'post_parent' => $post->ID,
'post_mime_type' => 'image',
'post_status' => null
);
$attachments = get_posts($argsThumb);
if ($attachments) {
foreach ($attachments as $attachment) {
apply_filters('the_title', $attachment->post_title);
echo '<img src="'.wp_get_attachment_url($attachment->ID, 'post-thumbnail', false, false).'" />';
}
}
}
add_shortcode('page-thumbs', 'page_thumbnails');