Define size for `get_post_gallery_images`, they seem to have been resized to 150×150

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,

Leave a Comment