This completely depends on how your gallery shortcode looks like.
If you replaced it with something custom, then you’ll have to take a look at the plugin (or the theme).
The default gallery shortcode gets it from a query:
$query_args = array(
'post_status' => 'inherit'
,'post_type' => 'attachment'
,'post_mime_type' => 'image'
,'order' => $order
,'orderby' => $orderby
);
Then it decides to add additional args for either include
or exclude
.
Here’re the 3 scenarios that add the additional/non-shared arguments.
'include' => preg_replace( '/[^\D,]+/', '', $include )
'exclude' => preg_replace( '/[^\D,]+/', '', $include )
// default
'post_parent' => $id
Related Posts:
- Gel all image from certain post type
- How to save media-form on custom tab
- Programmatically adding images to the media library with wp_generate_attachment_metadata randomly fails
- How can I bulk delete media and attachments using WP-CLI?
- complex restriction of items in media library
- Edit image / Delete image link
- media_sideload_image file name?
- Get all posts (of any post type) an attachment is used in
- Detect if is image unattached
- Unattaching unlinked images
- Show Post ID in “Find Posts or Pages” box in Media Library?
- Retrieving a custom link on an attachment
- how to test for attached image
- Can i hide the attachments from media which I uploaded from front end?
- ID of images from gallery
- Get the attachment URL on single.php
- Hide “Gallery Settings” and “Insert into Post” button from Attachment window
- Getting attachment images is cloning some of them
- Perform a custom (bulk) action in media view
- How to make a customized “Create Gallery” tab in the ‘Add Media’ window?
- Reorder “menu order” of attachments to another predefined order
- Add image attachment to post via coding?
- How to retrieve alt attribute for an attachment (uploaded image)?
- Ordering of gallery images without using shortcode in theme
- Custom Gallery HTML only working when images are attached to post/page
- Display random gallery images and its parent post title leading to parent post permalink
- Control attachments menu order with jQuery Sortable
- Is it possible to share media files between multiple WordPress sites?
- Open the Attachment Details popup
- Proper use of wp_get_attachment_image?
- how to get random media id from media gallery
- hide attached images of a post
- Upload multiple image with media_handle_upload with multiple file field [duplicate]
- WordPress Gallery Permalink Structure Displaying Incorrectly
- How do I get just the title from wp_get_attachment_image
- changing the default picture size link url
- Get an image from the media library. Struggling with the code?
- Programmatically Altering Gallery Link and image size?
- How is it possible that a gallery doesn’t have attachment ids?
- Media Library Mess After FTP … /uploads
- Media item permalink goes to source file instead of attachment.php
- wp_get_attachment_image_src calling wrong location
- Removing images deleted from uploads folder, from Media Library
- WP media attachment location vs permalink
- Removing delete permanently button in uploading files media
- Retrieve ONLY mp3s and set a variable for use in a playlist called by single.php template?
- Is there a way to add Reattach and Unattach links in image gallery?
- How to retrieve images contained in a post
- ID of images from gallery
- Gallery Thumbnail Layout Template
- Bulk delete media by year
- Media library upload hook
- Get all post attachments except featured image
- Changing attachment urls?
- Add custom class to attachment in media library grid mode
- How can I UN-attach media from a post?
- How to get attachments for a specific post type?
- How to remove title attribute from gallery links and images
- Make individual attachments private?
- Add size in Gallery Settings in Media Library
- Insert custom ID into wp_get_attachment_link
- How to add attachment without uploading?
- Change code to display image attachment page
- Show selected images on top in Media Manager
- How To Grab All Type Of Attachments, But Images?
- Removing width and height attributes from wp-get-attachment
- Change filename during upload
- Get post attachment images dimension and use in embed code
- use wp_get_attachment_image() to show attachments
- List Post Attachments – Remove Image Thumbnails
- How do i add LIGHTBOX to Attachments?
- How to specify width and height in the_content for image attachments
- delete image attachments of a custom post type except featured image
- Import Attachments – not attaching to post_parent
- Customizing the attachement page to show rest of all images in a gallery from post
- hook wp_generate_attachment_metadata does not read all the attachments
- Massive photogallery import
- How to load attachment in media library for current user?
- Post Gallery list attachments except the one used as post thumbnail
- Echo Permalink in Attachment outside of loop?
- How can I display a link to a post’s (Word doc or pdf) attachment?
- GUID field in wp_posts – relevance for attachments?
- Prevent image from being accessible via url as a post?
- get_post orderby not working in plugin
- Delete child post and attachment links to parent post
- Remove attachment from database
- How to get the next and previous image title from attachment or gallery?
- Display Audio Attachment URL
- File was uploaded, but it is not shown on media section of the dashboard
- wp_get_attachment_metadata is empty
- Attachments plugin cannot click media library button [closed]
- Restricted Attachments/Change Attachment Upload Location
- Hide Image Container if No Image Attachments
- Possible to “Attach” images to multiple posts without uploading twice from Add media Section?
- WordPress Attachments vs Post Meta
- open image after clicking on single.php with different stylesheet in wordpress
- How do I get link URL (not file URL or attachment URL) of an attached image [duplicate]
- Attachment page custom title?
- No attachments on contact form 7
- wp_mail attachment not working in wordpress