You could, but I wouldn’t recommend doing it on the fly as it would take up unnecessary page resources each time the user loads the page. A better way to do it would put in the add_image_size hook you mentioned into the functions file, then install a plugin to regenerate thumbnails. https://wordpress.org/plugins/regenerate-thumbnails/ I’ve used this one in the past and worked very well. You should only have to install it, generate the thumbnails once, and then you can uninstall the plugin. The thumbnails should generate on each upload after that.
Related Posts:
- make WordPress image captions responsive
- Responsive Theme Design: how have slideshow on desktops/tablets and static photo on mobile using same template?
- How to get attachment id of background image?
- Pb with responsive image sizes in WP 4.4
- Change function in responsive theme
- $content_width for responsive UI
- How do I make featured images retreived by the_post_thumbnail() responsive?
- GIF featured image is resized on server but not used in frontend. Why?
- Responsive 2 column staggered layout client expectations vs reality problem
- Responsive Video Max-width
- How to force the twentyfourteen narrow screen layout to apply to wide screens?
- twentythirteen h1 and h2 not resizing responsively
- YouTube video goes over sidebar [closed]
- Wp_List_Table not responsive
- mobile vs responsive sites [closed]
- Responsive Theme Design: how have slideshow on desktops/tablets and static photo on mobile using same template?
- responsive not working
- I want to add “View Desktop Version” for mobile visitors for my wordpress site
- Navigation Menu Rendering Issue on Windows 10
- Header Logo Scaling
- nextgen pro horizontal filmstrip moves up as browser narrows
- The hyperlink not responsive with post? [closed]
- Trouble with responsivitizing my twentythirteen header
- site is loading fully zoomed in on mobile devices
- Show content based on width?
- making images scalable for responsive designs [closed]
- Is Twenty Eleven Theme Responsive ? any update? [closed]
- How I can add responsive font size in theme.json file
- Proper usage of wp_is_mobile()?
- WP 4.4. responsive images browser choosing the “wrong” one
- WordPress Gutenberg Embed Blocks Are Not Responsive
- WP 4.4 aspect ratio with responsive image
- Benefits of storing uploads in an assets folder?
- Don’t load scripts if on mobile/tablet
- Change theme based on window size
- Run shortcode at certain resolution
- Responsive background images added inline
- Get a list of all image sizes that match aspect ratio of original one
- What controls responsiveness in WordPress?
- Removing height and width from images with a caption
- Why does my caroussel gallery do this in responsive? [CSS] [closed]
- Best practice for query_posts in responsive design?
- Twenty fifteen theme – change responsive menu condition
- Using SRCSET with Images and Featured Images
- Display Authors in a grid loop
- Old Site displays on Mobile View, not New Site
- Responsive menu gone on wordpress Responsive theme
- Implementing the twentythirteen responsive menu in twentytwelve
- Elements floating on top of each other when Resizing or checking site on mobile. Twenty Twelve
- No responsive design is displayed
- My website is not responsive on mobile devices
- Move Sidebar from Above Content To Below When Responsive [closed]
- Change Responsive Images Maximum Width of 1600px
- Custom responsive ‘featured image’ sizes
- One of my image sizes isn’t showing up in srcset
- srcset and custom field get_post_meta and wp_get_attachment_url
- How to load different homepage on Mobile.?
- Change Header Image on Blog Post for Mobile View
- How to stop WordPress from completely overriding my tags in my templates?
- the_content not showing responsive image attributes srcset or sizes
- Different column width in 2 rows with bootstrap and custom post types-different classes needed
- How to create a non-responsive WordPress Theme Using Genesis Framework?
- Define width of featured image thumbnails, but also make responsive?
- Change twentytwelve sidebar responsive relocation?
- Twenty Eleven Theme Adjusts for iPhones. How to stop this feature?
- Efficient wp mobile menu
- About Custom Email Template Design Responsive
- My theme header is stuck on a low resolution image?
- is there a way to preload specific images for desktop users only? (excluding mobile users)
- Responsive header image
- Cannot collapse a responsive menu in WordPress
- Disable Responsive Image Sizes crop
- Shortcode function not showing up on mobile browser
- How to make in wordpress a gallery with 3 colums to 1 on mobile devices responsive?
- WordPress 5: including larger thumbnail image sizes in srcset than I have set
- Disable rendering of objects on mobile/above certain screen resolution
- New Styles Not Rendering On Mobile Phone and Tablet
- Menu is in Reversed order
- Decide how Hero image appears on mobile
- 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?
- Sidebar widgets are over the content in mobile mode, how can I fix it? [closed]
- responsive website
- Should I detect the device or the page first?
- Responsive Wordress Site – Serve different post types to each device
- Ads below footer
- Removing backstretch image from pages/posts
- Serving resized images on a responsive site without making 2x copies
- Responsive framework – edit child js
- FitVid not working for iframes on particular theme install
- Image menu on responsive WordPress
- How would I use a media query to make my entire theme responsive or fluid? [closed]
- How to make this splash page responsive
- Hamburger Navigation Menu
- Custom page template not working on mobile
- Hiding site title for Twentyfifteen sidebar on (responsive) desktop display size
- Understanding responsive imagery
- How can I only show one responsive menu on mobile devices?
- Remove one srcset entry from wp_get_attachment_image