• I am using the attachments.php template to display post image attachments, however, I am excluding the feature image using:


    $attachments = array_values( get_children( array( 'post_parent' => $post->post_parent, 'post_status' => 'inherit', 'post_type' => 'attachment', 'post_mime_type' => 'image', 'order' => 'ASC', 'orderby' => 'menu_order ID', 'exclude' => get_post_thumbnail_id( $post->post_parent ) ) ) );

    The problem I am having is the next_image_link() and previous_image_link() still show the feature image as an option.

    Is there a way I can exclude the feature image from this navigation?

The topic ‘Exclude post feature image from next/previous_image_link()’ is closed to new replies.