I solved it! Instead of using the wp_get_attachment_link() function I used two new variables ($atturl and $attlink) which I combined later on with some simple HTML.
Problem now is that the post_parent argument doesn’t work correctly. When ‘null’ it does show my attachments (multiple thumbnails), but when I use $post->ID (or the ‘include’ argument with as value the numeric post ID), it shows blank. What is the problem?
Can anybody help?
<?php
$args = array(
'post_type' => 'attachment',
'numberposts' => 25,
'post_parent' => $post->ID,
'order' => 'ASC'
);
$attachments = get_posts($args);
if($attachments){
foreach($attachments as $attachment){
$atturl = wp_get_attachment_thumb_url($attachment->ID);
$attlink = get_attachment_link($attachment->ID) . '&paged=' . $paged;
echo '<a href="' . $attlink . '"><img src="' . $atturl . '"></a>';
}
};
?>