If you want get_post_gallery_images
to give you full size images, you can use the following:
// Use full size gallery images for the next gallery shortcode:
add_filter( 'shortcode_atts_gallery', 'wpse_141896_shortcode_atts_gallery' );
// Your code:
$gallery = get_post_gallery_images( $post );
foreach ($gallery as $img) { ?>
<li><img src="https://wordpress.stackexchange.com/questions/141896/<?php echo $img; ?>" /></li>
<?php }
where
/**
* Set the size attribute to 'full' in the next gallery shortcode.
*/
function wpse_141896_shortcode_atts_gallery( $out )
{
remove_filter( current_filter(), __FUNCTION__ );
$out['size'] = 'full';
return $out;
}
In this example we remove the filter after using it once, so it will not affect your other galleries.
This way you don’t have to include the size="full"
attribute in your gallery shortcodes,
Related Posts:
- Responsive Images
- Media gallery – inserting full size images without link
- Getting the image title/alt attribute from the gallery shortcode
- Can I attach an image to a different post?
- Add data attribute to a gallery link?
- Add Download Button in prettyPhoto Plugin
- Gallery Image Numbers?
- Display number of latest images from wordpress gallery in your homepage
- Why do the images only display in original size, not my custom size?
- Display Gallery Images from Custom Post Type
- Ipad app: Need uploaded images to go into “Gallery” as well as “Media Library”
- Gallery – custom html for inserting images
- Display custom gallery in each wordpress post
- Add anchor tag on previous_image_link / next_image_link
- Best approach when modifying the Media Manager
- How to show description under an inserted image?
- Navigate with keyboard in Gallery shortcode
- First three images in post excerpt
- How do you modify the HTML output of a Gallery item (using the gallery shortcode)?
- How I can get image description/title/alt for gallery image?
- How to include externally hosted images into a gallery block
- How can I make all gallery images to open in a new window?
- Proper Way to Remove Thumbnail Links In Gallery
- Disable Linked Gallery Images If Mobile Browser
- Possible to add same caption to all photos in a gallery?
- have WP Gallery display the title instead of caption
- How to get ID of images used in gallery?
- Gallery set to “Media file”, showing as attachment page
- 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?
- WordPress grab first image from gallery
- How can I create a gallery showing Ken Burns effect, when mouse hovers over images? [closed]
- Set default number of columns in gallery
- ACF gallery hook?
- Get attachments but only from post gallery?
- WooCommerce-like featured gallery
- Override img class in gallery
- In which version of WordPress was the new gallery shortcode implemented?
- Extracting gallery images in WordPress 3.5 on index.php
- Howto accurately position images with maximum flexibility?
- How to use photo in multiple posts?
- Exclude images from “inserted into post” when trying to get attachments
- attachment.php code or tutorial
- Upload photos to WordPress via ftp w/ [gallery] shortcode?
- NextGen Gallery Slideshow Positioning Issue
- Install Gallery 3 in Subdirectory of WordPress
- Inside text editor my preview gallery images are in full size
- How can I display an image description, from an image gallery?
- How do I export WordPress galleries?
- Gallery with thumbnail carousel
- Ways to show multiple, separate galleries per post?
- Gallery Shortcode Showing IDs
- How to get the Gallery form/section just like in Gutenberg block?
- How to show a manageable list of images on a post?
- Timthumb.php image gallery not working on Multisite WordPress
- Change default gallery images – Currently they are displaying full size imagese
- How to get images using taxonomy ( WP Media Folder)
- How to change gallery grid from 4 columns to 3 columns? [closed]
- Category view with contents of [gallery]s shown
- How to display some of images from media library?
- How to add a div around the default gallery output
- limit number of images shown from gallery
- What is the plugin to import image from URL?
- photo gallery implementation like tmz
- How do I display the featured image from an image gallery using a reference in code? (example within)
- Get the a specific image from the post gallery linked to post_id
- How to enlarge thumbnail on mouseover?
- How do I test whether [gallery] is empty?
- Personalized Gallery what are my options?
- get_post_gallery with Gutenberg
- Implementing a modal(lightbox) for all images in all post-gallery posts
- Easy Image Gallery – Retrieve Serialized Data
- Output all images from gallery inside a slider
- How to have two galleries side by side?
- Integrate video and iframe in a post type gallery
- WordPress Gallery is not displaying
- Error while uploading photos
- How do I extract a gallery image from databse?
- Issue on Getting WP Gallery Items In cpt-single.php As Attachments
- Options for an SEO gallery?
- attachment.php & flexslider—linking thumbnail to specific image
- gallery image size
- Moved blog – galleries don’t work
- I want to add a gallery to a post but I don’t want it displayed in the content?
- Breadcrumbs for Single Image page
- Gallery requires a featured image but does not show it in posts/pages
- Displaying only specific galleries using shortcode on a custom 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]
- Hide the ‘Gallery Settings’ section of the Gallery tab of the media Thickbox
- Gallery image must open up in fancybox directly not post page
- Getting top Image From the Gallery and printing out a thumbnail with Exact Dimensions
- Multiple Gallery Posts With Sldiers
- Convert WordPress default grid to carousel
- Image Attachments Query Not Working If Post Is Loaded Via Ajax
- how to add this type of gallary photo number counter?
- How to move all images in a post to a single gallery for a bunch of posts?