I am looking for this answer everywhere and can't find it. I setuo the wordpress default gallery using the attachment page which shows next and previous photos. everything is working fine and I have a loop of gallery with next and previous image post.
now, inside the gallery page where I uploaded all the photos I also added a "featured image" for a reason that I am using. unfortunately, it added this photo to my gallery loop as the last photo. I would like to exlclude the "Featured Image" from showing anywhere in the gallery (I use it only for a certain purpose)
I was looking at the code in the attachment.php and found this line which represents the photos:
<a href="<?php echo $next_attachment_url; ?>" title="<?php echo esc_attr( get_the_title() ); ?>" rel="attachment"><?php
$attachment_size = apply_filters( 'twentyten_attachment_size', 900 );
echo wp_get_attachment_image( $post->ID, array( $attachment_size, 9999 ) ); // filterable image width with, essentially, no limit for image height.
?></a>
I have no idea how to exclude it. can anyone help? any maybe function that does it? Thanks a lot
Gil