On single.php theme template file, I'm displaying the post's list of attachments.
global $post;
$args = array(
'post_type' => 'attachment',
'numberposts' => null,
'post_status' => null,
'post_parent' => $o_ID
);
$attachments = get_posts($args);
if ($attachments) {
echo '<ul class="slideshow-controller">';
foreach ($attachments as $attachment) {
//echo apply_filters('the_title', $attachment->post_title);
echo '<li>';
echo wp_get_attachment_link($attachment->ID, 'thumbnail', 0, 0, 'Download');
echo wp_get_attachment_image($attachment->ID, 'thumbnail',false);
echo '</li>';
}
echo '</ul>';
}
Weird, wp_get_attachment_link
works correctly (echoes the attachment's media link), wp_get_attachment_image
does not: it echoes nothing at all.
What am i doing wrong?