The source for the gallery shortcode is in wp-includes/media.php
. There are a couple of hooks in there that might work for you. Without knowing exactly what you want to do, it is impossible to be more specific.
If that doesn’t work then you can remove the shortcode:
remove_shortcode('gallery');
And add another gallery shortcode with the alterations you want. Just copy the function to functions.php
or to a plugin file, rename it, edit it, and add it back with add_shortcode('gallery', 'whatever_you_named_your_function');
Related Posts:
- How do I delete all UNUSED images from my uploads directory?
- How to extend the gallery block in Gutenberg?
- Prevent WordPress from adding image’ title automatically
- Overide Gallery Default Link to Settings
- get_post_gallery with Gutenberg
- How to have different captions for same image, for galleries?
- get_post_gallery_images returns thumbs . I want full size
- WP 3.5 and Galleries – how to count images?
- Navigate with keyboard in Gallery shortcode
- Cropped featured image replaces original image in gallery
- get images from post and make a zip
- Bulk edit wordpress images alt and title attributes
- Making WordPress Gallery (.gallery-item) Responsive?
- How do you modify the HTML output of a Gallery item (using the gallery shortcode)?
- How to include externally hosted images into a gallery block
- Excludes posts that don’t have attachments in the_content()
- Use Media Library to manage galleries like Nextgen (with folders, albums, collections, tags, categories, terms…)
- Setting up a gallery with images and a zip download
- How to remove title attribute from gallery links and images
- How can I make all gallery images to open in a new window?
- How to add php to theme to show alt attributes
- The WordPress Gallery, Grabbing The Link and Images?
- Displaying a featured image (only img url) as the img src?
- How to Display an Image Uploaded through a Meta Box in a Template?
- How to force WordPress to add new images at the beginning of the gallery?
- Display different header images based on current page
- How to link Gutenberg Gallery images To Media file automatically?
- How to Make WordPress Default gallery responsive on mobile?
- get attributes/part of the gallery shortcode
- Different captions for the same image in multiple galleries. Edit Image in Gallery locally
- Why is wordpress searching for @2x images?
- Editing built in Gallery shortcode to filter by categories
- Gallery images stored elsewhere (preferably Google Drive)
- WordPress gallery previous/next buttons showing all media library images
- Any way to “combine” galleries or show multiple galleries as one?
- Best option for photo/gallery handling?
- Gallery post images on homepage?
- How to create a simple slideshow out of a post image gallery?
- How to change the target size of images clicked on in WordPress standard gallery
- Get meta data from image
- Exclude featured image from gallery in wp-admin
- WooCommerce-like featured gallery
- Override img class in gallery
- Pull Random Attachments With Pagination
- Extracting gallery images in WordPress 3.5 on index.php
- wordpress get gallery images title
- How to use photo in multiple posts?
- Exclude images from “inserted into post” when trying to get attachments
- Is this post using WordPress Gallery?
- Turn off image captions in gallery view?
- How to create ‘Local’ filters for WordPress srcset sizes in template parts?
- Customizing the attachement page to show rest of all images in a gallery from post
- Unyson Framework doesn’t show gallery images
- Retrieve an array of image URLs that belong to a gallery
- Ho to add “Create Slider” option to default “Add Media” popup?
- How to make a gallery with dynamic images from URLs?
- How can I display an image description, from an image gallery?
- Removing featured image from gallery?
- Creating a post image to show in a gallery
- Don’t show images inserted into content
- Gallery with thumbnail carousel
- Ways to show multiple, separate galleries per post?
- Native gallery sorting is ignored
- Using Jetpack carousel w/o creating a gallery [closed]
- How to get the Gallery form/section just like in Gutenberg block?
- Media gallery images url instead of ID on WP API Response
- HowTo: develop WP template with dynamic background image
- Load Gallery Images with Title on Homepage BX Slider
- Get all image IDs from the Media Library
- Re-ordering images in existing post in wordpress 3.6.1
- Autosort uploads in galleries by filename
- How to display original unmodified thumbnail
- One picture belonging different galleries?
- Allow users to contribute images to a post
- I want to rel=nofollow wordpress images
- Apply nextgen-gallery lightbox effect [closed]
- How to remove the images from “Uploaded to this post”?
- How to create a title images for different posts?
- limit number of images shown from gallery
- How to automatically populate a gallery with images attached to posts of one category?
- What is the plugin to import image from URL?
- Pagination between images (active/inactive)
- Excluding post thumbnail from the attachment.php when using wordpress gallery
- Breadcrumbs for Single Image page
- Thickbox not displaying just the image, instead showing full page in lightbox
- Show uploaded images in full size
- Multiple gallery thumnbnails on one page
- Slider do not add alt attribute. Cant get alt attribute from a media library!
- wp_get_attachment_link() add rel attribute if the link points to direct image
- Paginate Gallery [closed]
- How do I set the sizes of my thumbnails when inserting a [gallery]?
- *box for images displayed as a post’s [gallery] [duplicate]
- Display X images from a gallery in the sidebar
- Getting top Image From the Gallery and printing out a thumbnail with Exact Dimensions
- Adding different classes to different images depending on size for fine control of image layout in posts
- Automatically adding blog images to a portfolio/gallery
- Image Attachments Query Not Working If Post Is Loaded Via Ajax
- Images uploaded in customized gallery do not link to media
- Fix position of an image while using elementor pro gallary widget
- Image shows up in editor, but not in published blog post