May be this filter should work intermediate_image_sizes
Note: This solution will work if you are uploading an image from post edit screen. (tested on localhost with WP-3.8.1)
add_filter( 'intermediate_image_sizes', 'ravs_slider_image_sizes', 999 );
function ravs_slider_image_sizes( $image_sizes ){
// size for slider
$slider_image_sizes = array( 'your_image_size_1', 'your_image_size_2' );
// for ex: $slider_image_sizes = array( 'thumbnail', 'medium' );
// instead of unset sizes, return your custom size for slider image
if( isset($_REQUEST['post_id']) && 'your_custom_post_type' === get_post_type( $_REQUEST['post_id'] ) )
return $slider_image_sizes;
return $image_sizes;
}
Related Posts:
- Creating an Image-Centric Custom Post Type?
- How to disable generation of default image sizes for some custom post types?
- Image size filtering in Media uploader according to custom post type
- How to rename image at uploading on specific plugin or post-type in WordPress
- Get image post ID in media upload
- How to Create an Image Upload Box for Custom Posts?
- frontend image post uploader
- Redirect to another page using contact form 7? [closed]
- How to add multiple images to a custom post type without plugin [closed]
- Multi Photo Upload with Caption on Front End for Custom Post Type
- Allow authors to create article image
- Add Image field to CPT
- add_image_size() for specific Post Types
- Correctly delete posts with meta and attachments [duplicate]
- Creating “static” taxonomies to choose from, inside custom post type?
- Using Images in WordPress – Best Practices
- Get custom post type by category in a page template
- Associating an “author” with a custom taxonomy
- Admin Post Update Redirection to Posts Screen
- Remove tabs from media uploader for a CPT
- Add custom field to media attachment image attribute in post editor
- Extract image src from a post and send it to an external form
- Single Page WordPress CSS and JS links
- [Plugin: Posts 2 Posts] Changing display order of connections
- Disable dragging of metaboxes in custom post types?
- Error after deleting Custom Post Type with a function (no trash used)
- How to delete all posts from a custom post type?
- Return Attachments from Custom Post Type
- Structure for projects and clients
- Why is my custom loop not filtering correctly nor paginating?
- Custom post types with custom directories
- Saving repeated option values in a custom query
- How to customize admin posts based on the user who is logged in
- Custom Post Type | Fatal Error on register_post_type()
- Change post featured image on hover
- How to get all `supports` attributes by post type?
- apply filters only to specific post listing without check the url parameters
- Dynamically add / duplicate custom meta in custom post types
- Cannot attach media when capabilities added to custom post type
- How can I create a custom meta box to add an mp4 video to a page?
- Custom Image Thumbnails of Different Sizes
- Custom post type menu missing after 3.0b2 -> 3.1.2 upgrade
- Group posts by custom post type
- Plugin: register custom post types, child ready and performance best practices
- Display users uploaded files as posts
- Add a button or image button that calls wp functions in the wp-admin
- How can i add thumbnails images to particular post (using code not admin pannel) in wordpress
- Define new user capability for custom post types?
- 2 Templates 1 custom post type according url
- changing meta value and meta key of price field
- Add custom image size for custom post type or taxonomy
- WordPress sort search results by custom order
- How to handle paged param in post and custom-post-type?
- Shortcode to display Staff post type based on Location post type and Specialty post type
- Problem: wp_query outputs all images on site
- How to add attributes to taxonomies that may be different from post to post?
- How does order=asc effect a wp_query (its acting pretty weird in a loop)
- How to sort posts in a custom post type by title in ascending order by default?
- Edit the_content() function so to add a div wrapper
- Replace dynamically content in a custom database table when a custom post is created
- Custom post type menu
- WordPress Count posts within a custom post type
- Custom Post Types and Removing Slugs – should we do it?
- Need to have an archive widget which organizes and displays a custom post type using a custom date field
- Custom Content Type with No Page View
- Custom post type tags not showing in search
- How to list posts by term (custom taxonomy)
- Thumbnails Not Generating
- Returning an image url from its attachment ID using a custom post type plugin
- What is the best way to manage small blocks of content on my home page?
- One post auto attached to many another items
- Custom Post Type Implementation
- Related “custom post type” using “custom taxonomy”
- Personalized Gallery what are my options?
- Not Able to Add New Class To CPT Attachment Image
- How do I disable the built-in editor and automatically configure the properties of new pages?
- How to have multiple search result pages in wordpress with taxonomy terms listed
- How to limit the number of custom posts certain users can publish in WordPress using php script?
- Custom page for creating/editing custom post type
- What is WordPress Way to Add Content Blocks to Post and Reference them as Many to One Relationship?
- wp delete duplicate entries of custom post types every 15 minutes
- Change picture attachment meta of all occurrences of a picture
- Displaying posts inside table having issues
- Building Link List for Custom Tax
- In the admin, how can you list thumbnails instead of titles for a custom post type?
- Looping through image object using ACF and CPT UI [SOLVED]
- Displaying image instead of post label in wordpress
- connect users to Custom post types
- creating a custom post template
- Custom user roles
- Cant edit custom post type in WordPress dashboard
- Advanced Custom Fields – Add Field to Specific Page [closed]
- Custom post type media upload error with custom user role
- Custom metabox value not saving
- Make title field multiline in the add new custom post page?
- Custom image sizes ignored in WP 3.5
- Advise on Custom Taxonomies and Structure
- Page template with custom query instead of archive-xxx.php?
- Delete old thumbnail when updating new
- Sort CPT by taxonomy AND THEN by custom field