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
- How do I disable responsive images in WP 4.4?
- Create image formats with different qualities when uploading
- How can I set image sizes and still have responsive images using the srcset attribute?
- How-to add rewrite rules to point the uploads folder to a subdomain
- Responsive Images
- Excess White Space Above Admin Bar on Frontend Using Twitter Bootstrap
- Making WordPress Gallery (.gallery-item) Responsive?
- Generating Responsive Background Image Sizes in PHP
- How can I serve different images depending on screen size with wordpress
- How to Make WordPress Default gallery responsive on mobile?
- How can I make wp default gallery responsive?
- How to exclude an image size from the WordPress srcset
- Get specific image size for small viewport width
- Video to stretch across the entire homepage [closed]
- Meta tag viewport
- How to display a different image size for mobile
- Can’t show custom post thumbnail sizes as background images
- How to make wordpress theme iframe responsive
- Fuzzy Images in WordPress 4.4
- How to set cookies to switch style sheets when a link is clicked and set it till another particular link is clicked?
- Making footer widgets responsive
- How to create ‘Local’ filters for WordPress srcset sizes in template parts?
- Mobile issue – website isn’t properly detecting screen size [closed]
- Fallback for missing srcset images
- max_srcset_image_width doesn’t work as intended
- Translate a word in a responsive menu
- @media in bluehost is being commented out [closed]
- adaptive featured images wordpress 4.4 grid
- Modify ‘Sizes’ Attribute for Images with Specific Class
- Responsive Images – crop don’t seem to work
- How to Implement Responsive YouTube Video Framing? [closed]
- wp_editor responsive?
- Set Post Thumbnails in Percents
- How to make gallery images responsive?
- Title has word broken when viewed in mobile [closed]
- Enqueue scripts based on browser width?
- Faster fonts on mobile
- Add Image Size for Featured Image with Responsive Design
- Menu toggle bar works only on some pages in WordPress
- Adding srcset to an image in ajax
- Disable Media File Image Link On Mobile Devices
- Generate responsive post thumbnails of same size
- Change “posts per page” depending on width
- Twenty ten or Twenty eleven as base for responsive child theme
- Whitespace between logo and site title in Twenty Twenty-Two
- Why does WordPress list all image sizes in srcset even if they’re larger?
- Need to make sidebar responsive only when screen width is greater than 1024px
- How to center entire columns on a page, and have it stay responsive?
- Responsive Featured Images Not Working
- Website Tablet Check Out Field Issue
- @media applying globally and not separately for each screen width [closed]
- How can I disable Jetpack plugin on mobile?
- WordPress not choosing the right image from srcset
- Site not 100% responsive
- Filter the_content() to add custom figure tags
- Header formatting works for safari but not chrome @media screen size technique on iphone
- How to handle responsive and non responsive websites in one WordPress Theme?
- Change get_post_thumb responsively?
- How to modify responsive images in post thumbnails
- Server Variables not recognized in certain posts
- Twenty Fourteen responsive CSS
- How to resize video lightbox popup in wordpress? [closed]
- Responsive table on ios safari
- How to generate a responsive output from plugin?
- Elementor Pro and Astra have different breakpoints – how to salvage?
- HTML content filtered on blog page
- Navigation menu, remove item from desktop
- What is the best way to incorporate responsive dropdown navigation menu into custom theme?
- How do I work with responsive images in WordPress? (img srcset/sizes)
- Generate / attach Image srcsets from ACF Image Field
- WordPress site is not loading properly ( showing a min-page)
- wp_get_attachment_image with custom size not rendering possible 2x srcset image