Just call this function in the init action. This action is fired for both frontend and backend. So it should look like this:
add_action( 'init', 'wpse4378_add_new_image_size' );
function wpse4378_add_new_image_size() {
add_image_size( 'wp_small', 60, 75, true ); //mobile
}
Related Posts:
- How can I add an image upload field directly to a custom write panel?
- How to catch images with blank dimensions?
- How to find attachment ID for first image in a post
- Having Problem On Getting WP Post Gallery Images URL
- Set first image (external) as featured image / thumbnail
- Hook event for upload image in the menu
- How to get an image transferred via FTP or script to appear in Media Manager?
- Add media and attach images to pages
- Is there a better way to implement responsive images than what WordPress uses by default?
- Save image as featured image
- How to show large image in checkout page using WP Ecommerce plugin [closed]
- Hook to get image filename when it is uploaded
- Resizing Images for a Gallery-Plugin?
- How to serve different thumbnails/images depending on users browser/platform
- How to Upload Images From a Folder (Not WP_Uploads)
- How to export post meta with images in wordpress
- Get attachments from a post
- Putting a resized image into media library with wp_get_image_editor(
- Display list of uploaded images, filtered by user under a specific user group
- Upload multiple images and insert them into custom html code
- Which is the better way to store images for the plugin?
- Uploaded attachment not set as featured image
- How do I change the image from the default mysteryman in the WP Profile page
- Hook after attachment added and cropped
- Conditional Generation of Image Sizes using add_image_size
- how to change image of jquery slider plugin
- WP Still Generating 150×150 Thumbnail Size Even After Un-Setting Small Size in Functions.php
- Cleaning a filename after image sideloading a url that contains `%20`
- How to list all images used on a specific page?
- Screenshots on plugin page taken old [closed]
- Resize not resizing images with Capitial extension like JPG
- How to move an image in a plugin to the upload directory and make it as a media of wordpress?
- The URL of images on my website changed after being set as featured image
- Getting incorrect filepath inside custom block front-end output using @wordpress/create-block tutorial
- WordPress Favicon not Working For Images/Videos/PDFs
- Adding the image selector/uploader to an admin back page
- WordPress discards PNG file when uploading plugin file
- Hook for validating and rejecting frontend image upload
- WordPress Iframe for blog image
- Replace the WordPress Media Library Uploader
- Caption Shortcode: what filter to change the image size?
- Filter the_content() to add custom figure tags
- Issue on Getting WP Gallery Items In cpt-single.php As Attachments
- Is it possible to convert various image types from remote URLs to WebP and then serve them immediately?
- Images not displaying on live server
- Using “add_image_size” to register custom image sizes inside plugins not working
- Leveraging Core Functionality in Icon Upload Plugin [closed]
- Displaying an Uploaded Image as a Custom Avatar in WordPress
- Add a custom image source
- Upload to a specific media folder created by FileBird Lite
- Set srcset on a block image
- Add self-closing shortcode button to TinyMCE in WP 4.6
- How Do I Use jQuery UI In My Plugin
- WordPress and multithreading
- Using preg_replace to clean widget output HTML
- Removing rules from .htaccess
- What is the best way to provide plugin users with a way to customized the styles
- Mapping multiple URLs to same page
- Add Products to Woocommerce through WP API
- Check if on Custom Post Type for TinyMCE buttons
- How to add Font Awesome 5 icons in WP Admin dashboard menu?
- Example of uninstaller routine to remove all custom theme options from wp_options
- Modifying values with add_action to be sent to db
- Options API – Validation Callback $input is NULL
- how to use preg_replace for wordpress video?
- Execution limit and Memory limit errors even i changed to 1024M and 600(cache.php,load.php)?
- How to save WP widget instances and options
- Function Get User Object By Username?
- How to run an add_action hook for specific page
- Is it possible to use add_filter from a theme to alter a plugin’s function?
- wp_insert_category() setting the ‘cat_ID’ gives not array error
- How can we display product price $104 on the cart while the credit card payment method is checked?
- Translation per IP location [closed]
- Add a select option of shortcodes like dropdown in tinymce
- WordPress class, using add_action to call member function does not work
- random code at the end of file after plugin upload
- $wpdb->prepare with LIKE and sprintf
- Why in this archive page that call query_posts() function show only the last 10 posts?
- How can I show posts for a single category?
- WP ajax requests not stacking?
- In wordpress plugin wp_signon shows error
- Problem with autoloader and namespaces
- AJAX call returns ‘testtest0’ instead of ‘test’ – why?
- Get audio metadata on file upload
- Clean way to initialize plugin in newly-added site when plugin has been network activated?
- Loading Images from Javascript on the Front End
- How to deal with different jQuery versions?
- Can I attach a plugin via my add_filter callback contents?
- converting a node.js project into a wp plugin
- Is “document loaded” different on admin side than public side?
- how to handle premium features in a wordpress plugin?
- Unexpected issue when using attachment_fields_to_edit filter
- How Can I Update wp_enqueue_scripts () From WordPress Option Page Radio Buttons
- Load textdomain from global languages directory
- Tie specific functions to options-update for limiting API requests
- How to set custom homepage via a plugin
- add_rewrite_rule not working
- Add admin settings and options
- Developing a wordpress.com shortcode [closed]
- Template locked block does not show appender