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 to get WordPress Dataviews component responsive?
- Media queries in Sass
- Full width image in separated row on wordpress (Ref attacted)
- How do I disable responsive images in WP 4.4?
- Proper usage of wp_is_mobile()?
- 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?
- Create image formats with different qualities when uploading
- How-to make the admin area mobile friendly [closed]
- How can I set image sizes and still have responsive images using the srcset attribute?
- Images all broken after migration and upgrade
- WordPress Gutenberg Embed Blocks Are Not Responsive
- How-to add rewrite rules to point the uploads folder to a subdomain
- Responsive Images
- WP 4.4. responsive loads normal image after loading the responsive image
- Why is wp_get_attachment_image_src returning wrong dimensions? [duplicate]
- the_post_thumbnail scaling not hard cropping
- Excess White Space Above Admin Bar on Frontend Using Twitter Bootstrap
- Making WordPress Gallery (.gallery-item) Responsive?
- Implementing Zurb’s Interchange Into WordPress
- Using FlexNav with WordPress [closed]
- Featured Image in 4.4 should be larger on mobile device
- WP 4.4 aspect ratio with responsive image
- How to use the responsive images feature from WP 4.4 in your themes
- WordPress core responsive video not working with shortcode
- How to oEmbed from custom field, responsive to container size and responsive
- Generating Responsive Background Image Sizes in PHP
- How can I serve different images depending on screen size with wordpress
- 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
- Trying to load a responsive CSS media query using Custom Taxonmy
- Two column layout using Bootstrap [closed]
- How can I make new .css file in child theme override styles in child theme’s style.css
- How to Make WordPress Default gallery responsive on mobile?
- wordpress responsive image srcset not working
- Responsive background images added inline
- How can i disable a plugin for a mobile phone?
- Responsive Images – Add srcset attributes to custom Images Function
- Get a list of all image sizes that match aspect ratio of original one
- How can I make wp default gallery responsive?
- How to switch css files according to devices and button click?
- Manipulate Output of wp_list_something: select menu instead of li’s
- How to exclude an image size from the WordPress srcset
- Get specific image size for small viewport width
- Responsive Images Resizing Images
- What tags should be used for themes to show the type of layout?
- ACF Plugin – Random Gallery Image with wp_get_attachment_image()
- Featured image (responsive) above content is too small after update to WordPress 4.4
- Video to stretch across the entire homepage [closed]
- Meta tag viewport
- How to display a different image size for mobile
- What controls responsiveness in WordPress?
- Can’t show custom post thumbnail sizes as background images
- Convert WP Menu to a Drop Down for Mobile browser
- How to make wordpress theme iframe responsive
- WP Responsive images – upload custom image sizes
- 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?
- Backstretch.js and thumbnail sizes to reduce loading time
- Removing height and width from images with a caption
- Making footer widgets responsive
- How to create ‘Local’ filters for WordPress srcset sizes in template parts?
- Display posts from a different website on Genesis Responsive Slider
- Add clickable arrows to parent menu items with children elements e.g. with
- Multiple amp-image overlays. How to properly do this in wordpress?
- Why does my caroussel gallery do this in responsive? [CSS] [closed]
- Mobile issue – website isn’t properly detecting screen size [closed]
- Fallback for missing srcset images
- max_srcset_image_width doesn’t work as intended