Your code and description seem to refer to the previous/next attachment navigation. That code is intended to display previous/next attachment navigation, and that’s exactly what it’s doing.
If you want to display all attachments:
- Within the Post Content, use the
shortcode
-
Programmatically, in the template file, use e.g.
get_posts()
, combined with e.g.wp_get_attachment_image()
:<?php global $post; $attachment_images = get_posts( 'post_type' => 'attachment', 'post_parent' => $post->post_parent, 'post_mime_type' => 'image' ); // Output images ?> <ul> <?php foreach ( $attachment_images as $attachment_image ) { // Output images here. Note that get_posts() // returns an array of OBJECTS, so the ID // would be $attachment_image->ID echo '<li>' . wp_get_attachment_image( $attachment_image->ID, 'thumbnail' ) . '</li>'; } ?> </ul>