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?
- WP 4.4. responsive images browser choosing the “wrong” one
- How to insert pictures without hard coded dimensions?
- How to have different captions for same image, for galleries?
- WP 3.5 and Galleries – how to count images?
- Cropped featured image replaces original image in gallery
- Change the output for [gallery] shortcode
- 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
- WP 4.4 aspect ratio with responsive image
- Excludes posts that don’t have attachments in the_content()
- How can I make all gallery images to open in a new window?
- Add CSS class to every image
- How to force WordPress to add new images at the beginning of the gallery?
- Responsive Images – Add srcset attributes to custom Images Function
- Get a list of all image sizes that match aspect ratio of original one
- 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?
- Responsive Images Resizing Images
- Gallery post images on homepage?
- Exclude featured image from gallery in wp-admin
- WP Responsive images – upload custom image sizes
- WooCommerce-like featured gallery
- Removing height and width from images with a caption
- Extracting gallery images in WordPress 3.5 on index.php
- wordpress get gallery images title
- How to use photo in multiple posts?
- Customizing the attachement page to show rest of all images in a gallery from post
- Image not shown in the theme as it’s showing in HTML template [closed]
- Why does my caroussel gallery do this in responsive? [CSS] [closed]
- Retrieve an array of image URLs that belong to a gallery
- Ho to add “Create Slider” option to default “Add Media” popup?
- How to handle a background-size: cover image in WordPress?
- Using SRCSET with Images and Featured Images
- How to make a gallery with dynamic images from URLs?
- Background-image not showing? [closed]
- Responsive Images Warping
- t5-fresh-editor-stylesheets.php breaks image placement in WP Beta 3 editor
- How can I display an image description, from an image gallery?
- Ways to show multiple, separate galleries per post?
- Native gallery sorting is ignored
- Using Jetpack carousel w/o creating a gallery [closed]
- Custom image size vs CSS sizing
- How to get the Gallery form/section just like in Gutenberg block?
- Custom responsive ‘featured image’ sizes
- One of my image sizes isn’t showing up in srcset
- Load Gallery Images with Title on Homepage BX Slider
- Get all image IDs from the Media Library
- How would you add sequentially numbered labels to images in posts?
- How to stop WordPress from completely overriding my tags in my templates?
- the_content not showing responsive image attributes srcset or sizes
- Serve different images per screen size and cache possible?
- How to remove the images from “Uploaded to this post”?
- 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 to enlarge thumbnail on mouseover?
- get_post_gallery with Gutenberg
- How to change Gallery image url in product page ? In function.php?
- How do you obtain a list of all image file names on a wordpress website for replacement?
- Implementing a modal(lightbox) for all images in all post-gallery posts
- Responsive header image
- Images getting smashed
- How to re-arrange images in default WP Gallery more than one image at once?
- Convert multiple image blocks to gallery block in Gutenberg?
- Images 404 after wp migration to a subdomain
- Decide how Hero image appears on mobile
- Exclude first image from a Woocommerce image gallery
- Adding custom html/css/images to Theme
- Responsive images with srcset
- Getting extra image links in code with wp_get_attachment_image
- built-in responsive images in content – do I need to add anything to functions.php?
- Why do images inserted in the post content via the_content() go off the max-width?
- Put image onto header
- Gallery Images could not be shown
- Gallery with shortcode not showing
- attachment.php & flexslider—linking thumbnail to specific image
- How to display every pictures from all the posts on one page?
- How to add multiple images in a page
- Breadcrumbs for Single Image page
- Slider do not add alt attribute. Cant get alt attribute from a media library!
- Paginate Gallery [closed]
- *box for images displayed as a post’s [gallery] [duplicate]
- Adding different classes to different images depending on size for fine control of image layout in posts
- Theme using masonry layout script rendering overlaped images in Google Chrome [closed]
- Why is inline CSS added to images automatically? [closed]
- Create decorative image border with CSS? [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