You can use the exclude
parameter.
global $post;
$args = array(
'exclude' => get_post_thumbnail_id( $post->ID )
'post_type' => 'attachment',
'post_mime_type' => 'image',
'numberposts' => -1,
'orderby' => 'menu_order',
'order' => 'ASC',
'post_parent' => $post->ID
);
$images = get_posts($args);
http://codex.wordpress.org/Template_Tags/get_posts
http://codex.wordpress.org/Function_Reference/get_post_thumbnail_id
Related Posts:
- How to view exact image dimensions of a media in Admin view?
- How To Retrieve An Image Attachment’s Alt Text?
- getting attachement images src and add classes
- Check if post has attachments (not image)
- Validate alt text for attachments?
- Applying automatic link class to images embedded to posts
- How do I delete all generated images from my server except those currently used in posts
- Can I attach a document (eg: PDF) but have a JPEG as a thumbnail?
- get post attachments of a particular size
- Change image link: wp_get_attachment_link
- Making images from single.php pointing to an attachment .php template
- wp_get_attachment_image_src always returns false
- Exact image sizes
- Get the size (size in Kb or MB) of an featured image?
- query attachment images … if no attachments -> get attachments of parent page?
- Edit default image attachment size
- Change code to display image attachment page
- Attachment 0×0 size error [closed]
- Add image attachment to post via coding?
- Removing width and height attributes from wp-get-attachment
- Get post attachment images dimension and use in embed code
- use wp_get_attachment_image() to show attachments
- Show attached media image if no thumbnail image detected
- Adding width and height to wp_get_attachment_image_src
- Get the bare URL for an attachment
- Display attachment resolution size
- How to check if there is image title, caption, description?
- How to remove attachments size attribute [duplicate]
- How to redirect ‘file url’ to ‘post url’ i.e. in attachment.php
- Check what attached image size is used
- hook wp_generate_attachment_metadata does not read all the attachments
- How do I get all attachments that are used in the current post, not just the children?
- Clean up images, delete unused image sizes attached to a post type
- What is the best way to store thumbnails for a non-image attachment?
- Delete associated thumbnails when calling wp_delete_attachment
- How to create resized versions of images added with wp_insert_attachment
- Get title of post image is attached to
- Correct attachment size
- Get image attachment to a post outside the loop?
- Echo list attachment size in post
- How do I intercept and modify the functionality of wp_get_attachment_image()?
- Unable to get wp_get_attachment_url to show
- Get Attachment Image Class by attachment id
- Possible to add “Even/Odd Classes” to image attachments via wp_get_attachment_image?
- How to get thumbnail from post attachment in this loop
- changing the default picture size link url
- Get an image from the media library. Struggling with the code?
- Filter not applied to all image sizes
- wp_get_attachment_image_src calling wrong location
- Get attachment URL from attachment Link in WordPress
- How to disable post-thumbnail from generation?
- Display setting ‘size’ not available in image settings modal
- Hide Image Container if No Image Attachments
- Create a custom attachment thumbnail for quick page load
- Incomplete attachment page
- How to retrieve “custom url” from image attachment in wordpress
- Retreive tags from attached post for media on page
- list of attachments: wp_get_attachment_link works, wp_get_attachment_image does not
- What is the most efficient way to retrieve a group of image URL’s from different attachment ID’s of a specific crop size?
- get_image_tag filter not working
- Change attachment inside the_content using filters
- How does WP media uploader create the 3 different sized images, and how can I duplicate it
- wp_get_attachment_image_src and server path
- complex restriction of items in media library
- Edit image / Delete image link
- How could I add button next to “edit image” button in “Attachment Details”
- How to add classes to images based on their categories?
- Insert Media – Attachment – Link to : Remove the “attachment page” option
- Get Attachment ID from URL [duplicate]
- Add_image_size not cropping
- Image Quality Thumbnail Compression in WordPress?
- Use ‘medium’ size with catch_that_image() function
- Custom Gallery HTML only working when images are attached to post/page
- How do I link an image to the post it is attached to?
- Getting “too many redirects” when using wp_redirect for attachment page
- Can’t generate thumbnail images
- Does wp_get_attachment_image_src also work with non-image files?
- Filter for post_thumbnail: link to small src and add data-attribute [duplicate]
- the_time() returning wrong date/time (way in the future)
- Add audio attachment link to RSS
- Upload attachment from external site
- Could not get attachment using wp_mail
- Use full size images in a specific gallery
- Random Characters in the end of every image url in post
- i want attachment.php to return the image
- wp_get_attachment_image_src() with advanced custom fields returning empty
- Broken thumbnails (sometimes) with TimThumb
- Can i have 2 separate Galleries on 2 separate pages each go to a DIFFERENT Attachment.php file?
- Is it possible to save crop to a different size of the image when in image editor?
- Apply manual image cropping not to thumbnail but medium_large size
- Send data URL string as an attachment in wp_email
- How to use previous/next image link, ignoring parent posts/attachments?
- Using $_FILES variable into the same function for uploading images and files
- get the post thumbnail returns the full size
- Custom attachment field dissapearing
- How can I let users access a specific attachment?
- How to wrap this Link with an Image?
- I want to edit documents on my blog without the need to download and upload files again [closed]
- One audio attachment, with two possible interchangeable extensions
- Remove one srcset entry from wp_get_attachment_image