You can easily do this using HTML and CSS. You can write 2 blocks of div for the same image and toogle display:none; properties in CSS using media queries as shown below. Note: I have remove the “a href” tag for mobile.
<!--HTML Start -->
<div class="image-grid desktop">
<a href="#"><img src="#" /></a>
<div>
<!--For Mobile -->
<div class="image-grid mobile">
<img src="#" />
<div>
<!--HTML End -->
<!--CSS Start -->
.image-grid.mobile{display:none;}
@media only screen
and (min-device-width: 320px)
and (max-device-width: 480px)
and (-webkit-min-device-pixel-ratio: 1) {
.image-grid.desktop{display:none;}
.image-grid.mobile{display:block;}
}
<!--CSS End -->
Related Posts:
- Multiple amp-image overlays. How to properly do this in wordpress?
- Using SRCSET with Images and Featured Images
- Decide how Hero image appears on mobile
- Responsive images with srcset
- Making a thumbnail if there exist a link with. jpg or .png extension in WordPress
- How do I disable responsive images in WP 4.4?
- WP 4.4. responsive images browser choosing the “wrong” one
- the_post_thumbnail responsive srcset not populating with custom image size
- How to insert pictures without hard coded dimensions?
- Is there a hook which fires after all thumbnails are generated?
- Is there a simple way to just insert a link to an image (without inserting an image)?
- get_the_post_thumbnail_url with an unregistered size
- Cropped featured image replaces original image in gallery
- Default Image Link Removal
- How do I delete all generated images from my server except those currently used in posts
- Why is wp_get_attachment_image_src returning wrong dimensions? [duplicate]
- Making WordPress Gallery (.gallery-item) Responsive?
- WP 4.4 aspect ratio with responsive image
- How to add a link in a image’s caption?
- How can I serve different images depending on screen size with wordpress
- No srcset for hard-cropped thumbnails
- Cannot access the thumbnails of attachment images… Cannot find the reason
- How to remove link from an image in a post?
- Removing Title Tag from Thumbnails
- How to Make WordPress Default gallery responsive on mobile?
- Responsive background images added inline
- Responsive Images – Add srcset attributes to custom Images Function
- Get a list of all image sizes that match aspect ratio of original one
- How to make programmatic image upload generate thumbnail and sizes?
- Disable wordpress image sizes generation
- Remove ‘wp-content/themes/themename/’ from Image path
- WP 3.4 has missing photo data
- How to exclude an image size from the WordPress srcset
- Responsive Images Resizing Images
- Display latest 12 images from media library
- Image Quality Thumbnail Compression in WordPress?
- Featured image (responsive) above content is too small after update to WordPress 4.4
- How to display a different image size for mobile
- Lazyload post thumbnails
- Show full image thumbnail
- Get thumbnail url of custom meta image?
- WP Responsive images – upload custom image sizes
- Mobile Featured Image Bug
- Fuzzy Images in WordPress 4.4
- All Images on wordpress site broken
- Image thumbnails not available post migration, but still accessible via direct URL – DB issue
- Removing height and width from images with a caption
- Upload media files to Amazon S3
- How to create ‘Local’ filters for WordPress srcset sizes in template parts?
- How to stop thumbnail generation from some images and different size thumbnail generate
- Update old Post image metadata to ‘thumbnail’ wp_attached_file
- How to stop wordpress always displaying full-res images
- Fallback for missing srcset images
- Move Image Captions Inside Link ( tag) if Added
- Is it possible to change ‘Link to’ in all images in all articles?
- max_srcset_image_width doesn’t work as intended
- Help With Custom Image and Text Widget
- Scaling images for mobile
- How to filter the image embed code based on link type
- I am getting useless alphabets in images link
- Fixing image names for a site being restored
- force feed readers to pick atom version
- How to make thumbnails of uploaded animated gifs NOT animated
- Gallery with thumbnail carousel
- Is it possible to change image size used for preview thumnail in Add Media popup
- Filter for post_thumbnail: link to small src and add data-attribute [duplicate]
- Add clickable link on an image
- Understanding WordPress image sizes and responsive images
- Custom responsive ‘featured image’ sizes
- One of my image sizes isn’t showing up in srcset
- Dynamic image crop in WP 3.0+?
- Clicks registering on Preview DNS site
- How do I get a smaller size of an avatar image
- Why WordPress suddenly changed sizes of thumbnails?
- How to stop WordPress from completely overriding my tags in my templates?
- Stop WordPress compressing images? – Quality is terrible
- How do I link a featured photo to it’s post?
- Rebuild thumbnails via WP Cli – how?
- Adding srcset to an image in ajax
- Can we use featured image as third party website image URL
- Row background image not showing in mobile browser served from wamp local host
- Get an image from url, resize it, and save on a custom folder (not the media library)
- Disable save as image on smartphones using all browsers ( chrome, firefox, ie, cm, opera )
- the_content not showing responsive image attributes srcset or sizes
- add_image_size not working
- Serve different images per screen size and cache possible?
- Product Images Low Quality After Updating From WP 3.5 to 4 [closed]
- adding image to post thumbnail from another server
- All 3?: Responsive resizing of images + image width of actual image for small images + max-width for all larger images
- Hiding Media Source Links
- How to add thumbnails to posts and pages automatically in a uniformed fixed elegant way?
- Change Image Sizes for Mobile Theme
- Link to full-size image for subscriber only
- Broken thumbnails (sometimes) with TimThumb
- Web App mode leaves users stranded when following image links when using WPTouch with W3 Total Cache [closed]
- Is it possible to save crop to a different size of the image when in image editor?
- how to change format jpg to webp?
- Why does WordPress list all image sizes in srcset even if they’re larger?
- Responsive header image
- Apply manual image cropping not to thumbnail but medium_large size