There is a simple solution for this. Let the gallery use the 5 column grid system and using the @media-queries we can alter it for tablet and mobile. I just tested it on your given URL and it works perfect. But try to remove any custom codes you have used before since I had to remove it in order to use the following code.
/* For displaying 3 columns on tablet */
@media only screen and (max-width: 800px) {
.gallery-columns-5 .gallery-item {
width: 33%;
}
}
/* For displaying single column on mobile */
@media only screen and (max-width: 480px) {
.gallery-columns-5 .gallery-item {
width: 100%;
}
}
.gallery-columns-5 .gallery-item:nth-child(5n+1) {
clear: none;
}
Related Posts:
- How to Make WordPress Default gallery responsive on mobile?
- Responsive background images added inline
- Override img class in gallery
- Multiple amp-image overlays. How to properly do this in wordpress?
- All 3?: Responsive resizing of images + image width of actual image for small images + max-width for all larger images
- Can i have 2 separate Galleries on 2 separate pages each go to a DIFFERENT Attachment.php file?
- Is there a good way to use CMS images with CSS
- How do I disable responsive images in WP 4.4?
- 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
- How to reference a theme image in a stylesheet?
- get_post_gallery_images returns thumbs . I want full size
- Cropped featured image replaces original image in gallery
- Responsive Images
- get images from post and make a zip
- Adding HTML within an image title attribute
- Excludes posts that don’t have attachments in the_content()
- Width 100%: Aspect ratio of image
- How can I serve different images depending on screen size with wordpress
- Setting up a gallery with images and a zip download
- How to remove title attribute from gallery links and images
- The WordPress Gallery, Grabbing The Link and Images?
- How to force WordPress to add new images at the beginning of the gallery?
- Different captions for the same image in multiple galleries. Edit Image in Gallery locally
- @wordpress/create-block image url in css
- How to exclude an image size from the WordPress srcset
- Responsive Images Resizing Images
- Best option for photo/gallery handling?
- Featured image (responsive) above content is too small after update to WordPress 4.4
- Gallery post images on homepage?
- How to create a simple slideshow out of a post image gallery?
- How to display a different image size for mobile
- 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
- WP Responsive images – upload custom image sizes
- Fuzzy Images in WordPress 4.4
- wordpress get gallery images title
- 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
- Fallback for missing srcset images
- max_srcset_image_width doesn’t work as intended
- Responsive Images Warping
- Removing featured image from gallery?
- Gallery with thumbnail carousel
- Ways to show multiple, separate galleries per post?
- How to get the Gallery form/section just like in Gutenberg block?
- Understanding WordPress image sizes and responsive images
- Media gallery images url instead of ID on WP API Response
- One of my image sizes isn’t showing up in srcset
- Get all image IDs from the Media Library
- Allow users to contribute images to a post
- How to upload and style svg logo?
- css to fit image by HEIGHT
- Moving an image to the side [closed]
- limit number of images shown from gallery
- What is the plugin to import image from URL?
- Excluding post thumbnail from the attachment.php when using wordpress gallery
- photo gallery implementation like tmz
- How do I display the featured image from an image gallery using a reference in code? (example within)
- How to enlarge thumbnail on mouseover?
- attach several images to post + gallery
- get_post_gallery with Gutenberg
- Implementing a modal(lightbox) for all images in all post-gallery posts
- What’s are some best practices for responsive images (e.g. for section headers)?
- how automatically show the image title before the image caption/description in a wordpress gallery?
- change the h3 subtitles of the wordpress gallery shortcode
- get_post_gallery with Gutenberg
- Responsive Images – Defining
- Decide how Hero image appears on mobile
- Getting extra image links in code with wp_get_attachment_image
- Why do images inserted in the post content via the_content() go off the max-width?
- Using a full-width hero image that can be changed in the dashboard by a user
- Responsive images in Bootstrap 4 slider
- Image thumbnail on single product issue | WooCommerce
- Background image call problem
- How do i replace the title attribute of img tag with the image caption
- attachment.php & flexslider—linking thumbnail to specific image
- Breadcrumbs for Single Image page
- An image on my site is showing as the wrong image [closed]
- Theme files and imagesnot loading on a mobile device
- 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]
- Getting top Image From the Gallery and printing out a thumbnail with Exact Dimensions
- Parallax image problem
- Automatically adding blog images to a portfolio/gallery
- Theme using masonry layout script rendering overlaped images in Google Chrome [closed]
- Why is inline CSS added to images automatically? [closed]
- I am having trouble displaying an image at the top of a widget area [closed]
- Generate / attach Image srcsets from ACF Image Field
- Images uploaded in customized gallery do not link to media
- CSS how to target the caption of one individual image?
- Remove srcset thumbnail attribute for products in the WooCommerce shopping cart
- wp_get_attachment_image with custom size not rendering possible 2x srcset image