If you want to detect the browser in PHP, there are plugins like PHP Browser Detection that will provide conditionals that will allow you to do that. Then depending if the browser is desktop or mobile, you can grab the images with the specific size you want with wp_get_attachment_image
Related Posts:
- The the_post_thumbnail without srcset?
- How can I set image sizes and still have responsive images using the srcset attribute?
- How to get gallery images?
- add_image_size is scaling, even though crop is set to true
- Featured Image in 4.4 should be larger on mobile device
- How to use the responsive images feature from WP 4.4 in your themes
- How do I get gallery thumbnail URL and change the default thumbnail size?
- Cannot get full thumbnail size using the_post_thumbnail
- What tags should be used for themes to show the type of layout?
- Responsive Images – crop don’t seem to work
- What is the meaning of WordPress’s recommended css classes and where are they applied?
- Custom image size vs CSS sizing
- Change Responsive Images Maximum Width of 1600px
- Change image size depending on page
- Are seven additional image sizes are too many?
- Create theme for mobile phones and tablets only?
- How to hide custom sidebar on mobile
- How to add cropped custom header image?
- Is there a way to serve different resolution images to different devices?
- Responsive Images with art direction
- Should I detect the device or the page first?
- Can’t upload images on new theme
- Correct way to make a custom block theme responsive
- Sizing screenshot.png without losing aspect ratio
- How to detect mobile devices and present them a specific theme?
- WordPress Theme Preview Image
- How to add CSS class to custom logo?
- How to add custom css file in theme?
- theme path in javascript file
- Is wp_is_mobile() effective?
- get_template_part vs action hooks in themes
- The proper way to include/require PHP files in WordPress
- Get the first image from post content (eg.: hotlinked images)
- after_setup_theme always runs
- Do I actually need to link my theme’s style.css in the theme files
- Using classes instead of global functions in functions.php
- WordPress API Menu/Submenu Order
- How to insert a logo in the header?
- How to move page template files like page-{slug}.php to a sub-directory?
- CSS classes for theme
- Add custom classes to anchor in wp_nav_menu
- How to remove search bar from a wordpress theme? [closed]
- Should `get_template_directory_uri()` be escaped?
- Get url of thumbnail from the media uploader
- My child theme doesn’t work Error: “The parent theme is missing. Please install your parent theme”
- How To Add New Option Types To Option Tree?
- WP 3.4 – what action/hook is called when theme customisation is saved?
- What WP folder can I use to write files to?
- How to modify an image block in Gutenberg WordPress 5?
- Are the WordPress Core CSS styles really all nessesary?
- Add a dropdown to theme customizer
- Should I use set_transient or update_option?
- Why doesn’t default WordPress page view use force_balance_tags?
- Add default Backgrounds
- Page template in two level deep folder
- Edit srcset and sizes attributes in Gutenberg image, cover and gallery – blocks
- Theme Customizer : how to create multiple-level panel
- Why I can’t add a CSS style in this WordPress theme?
- Theme file for all pages that are a child of a specific page
- Allow Shortcode in Theme Customizer
- Where to post/upload the new theme for WordPress theme repository
- Setting multiple default background images?
- Template for individual post designs
- How to make a theme with more than one CSS file?
- Is it good to rename theme folder downloaded from WordPress.org?
- wp_get_attachment_image_attributes not working for me
- Best practice way to implement custom sections into a WordPress theme
- Editing the custom background CSS
- What is the problem if I use CDN in my WordPress parent theme(built using bootstrap)?
- Specify image dimensions
- register_sidebar ignores ‘id’ and ‘class’
- What, specifically, should be included in theme_name_setup()?
- Is it possible to use line break in theme description?
- Is the theme customizer slowing down my site?
- How can I get wp_head() as a string instead of echoing it?
- Display a different theme for not logged-in users
- Best practice (forward compatibility) for theme options
- Automatic Updates For Private And Commercial Themes?
- Excess White Space Above Admin Bar on Frontend Using Twitter Bootstrap
- Add colors to existing color palette without replacing it
- Child Theme not loading parent CSS
- What can I hook into after_setup_theme?
- Where do I find the functions triggered within a hook?
- What does “Do not deregister the jquery script in the administration area” mean?
- What is the best book to learn how to make themes for wordpress?
- Grab the first paragraph of each post
- Use of undefined constant FS_CHMOD_DIR – assumed ‘FS_CHMOD_DIR’
- How to show next Post Thumbnail image in WordPress using current post id
- Symlink a directory to wp-content/themes
- Single Page WordPress Theme – Using page templates
- Confused about image sizing business in WordPress
- Unexpected width and srcset attributes for the_post_thumbnail();
- Pushing updates to your premium theme
- Registering Sidebars and Sidebar Widgets. Sidebar Widgets Not Displaying
- Where can I find a good reviewed collection of Twenty Ten child themes?
- How to check if post has any tag?
- What are WooCommerce starter themes? [closed]
- Front End Post Submit Form
- How do I “unhook” / de-register jQuery so that it’s not called as part of wp_footer();?
- How do I get a parent theme modification from a child theme?