Add this code to your functions.php
if(function_exists('add_theme_support'))
add_theme_support('post-thumbnails');
// Set the thumbnail size
add_image_size('custom_logo', 200, 200, true );
add_image_size('custom_website_thumb', 450, 200, true );
add_image_size('custom_print_ad_thumb', 200, 400, true );
Put this in your post template where you want to see the image.
<?php echo get_the_post_thumbnail($post_id, 'custom_logo'); ?>
You can also wrap it in a link like this.
<a href="https://wordpress.stackexchange.com/questions/36677/<?php echo get_permalink($post_id) ?>" title="<?php echo get_the_title($post_id); ?>"> <?php echo get_the_post_thumbnail($post_id, 'custom_logo'); ?></a>
You can see the WordPress Codex for more exploitation.
Remember to set the images as a featured image on upload to be able to use it.
Related Posts:
- add_image_size() for specific Post Types
- How to disable generation of default image sizes for some custom post types?
- set_post_thumbnail_size in percent, not pixels?
- add_image_size for post type
- Change post featured image on hover
- Link to full size post thumbnail
- Multiple featured sizes / images / excerpts
- How can i add thumbnails images to particular post (using code not admin pannel) in wordpress
- Is it possible to add posts and images (auto resize) for custom post types with a script?
- Using Image Sizes for Custom Post Types outside the Loop
- link featured image to external link
- Thumbnails Not Generating
- Front end post or photo or both
- set_post_thumbnail or media_sideload_image adds image multiple times in media library
- How to Create Grey Background for Product Images on Website Display but Retain White Background on Downloaded JPGs?
- How come Featured Image isn’t showing up in my Custom Post Type?
- Creating an Image-Centric Custom Post Type?
- Using add_theme_support inside a plugin
- Why does my custom WP role need edit_posts to edit images?
- Custom user role cannot see or modify featured image
- Make featured image required
- How to remove “featured image” functionality from a custom post type?
- Featured Image Panel Missing From Custom Post Type in WordPress 3.2
- List most recent image uploads, but only for specific custom post type
- How to add a CSS class to every image in a Custom Post Type
- Best way to filter featured image text for a custom post type?
- Custom post type Admin Page
- If featured image doesn’t exist, show post content
- set and unset the custom field value
- Extract image src from a post and send it to an external form
- Removing Image Sizes for Custom Post Type
- How I upload, save and set a featured image from my frontend?
- Problem: wp_query outputs all images on site
- unable to show custom post type featured image
- Problems with image size on the server WordPress
- frontend image post uploader
- Adding custom image sizes and post types to a plugin or to a theme?
- How do you create a custom template to display a category with an image and related posts below?
- How to handle large number of images in a post?
- How do you get the full size url of an attachment image
- Redirect to another page using contact form 7? [closed]
- How to add multiple images to a custom post type without plugin [closed]
- how to post default thumbnail if post not created yet
- get_the_post_thumbnail_url(‘full’) returns empty from custom post type
- Set featured image to archive.php
- Unable to set featured image
- Post-thumbnail only for specific post-types?
- How can i link a custom post type thumbnail to intermediate size
- Featured image size in column
- False Positive on has_post_thumbnail
- 3 random images from custom post type, each in a div with a diffrent class
- Custom post doesn’t show featured image
- How do you output an unknown number of images in a custom post type with desired markup?
- Auto post creation
- copy images from custom field to another custom field
- Dynamic pages for linked categories and content
- Cannot upload featured image to a custom post type
- Should i use custom post type for a custom footer?
- Add Permalink to Post Thumbnail, syntax code issues
- Returning an image url from its attachment ID using a custom post type plugin
- Need help with simple “if statement” checks to output particlular CPT data depending on what client uploads/fills out
- Images not load on custom post type sidebar, related posts
- Not Able to Add New Class To CPT Attachment Image
- How to add Support to show Fullwidth Featured Image of Custom Post Types in WordPress.?
- i need to have a tab with gategory post
- Put featured image under post title in admin area
- How to add a default predefined thumbnail when creating a brand new post?
- DIVI Theme customizer changes not applied on existing pages and designs are not shown on the front
- How can I add image sizes for a specific custom post type?
- Change picture attachment meta of all occurrences of a picture
- Dupplication of Custom Post Type while adding attachment
- Media is not showing on post page
- Looping through image object using ACF and CPT UI [SOLVED]
- Multi Photo Upload with Caption on Front End for Custom Post Type
- Display featured images from custom post type in the homepage template
- Displaying image instead of post label in wordpress
- Links Image in “Catalog” Page to Posts
- why featured image option isn’t showing in custom post type?
- Add featured image programatically to custom post type
- retrieve custom post image through widget
- How To Loop Through list with Custom Post Types
- How do I set a specific size for my image?
- Trying to get custom post type attachment images to function in indexed array
- Working with gallery shortcode and get gallery images
- Image paths on custom post types getting /post_type/ added to path
- Thumbnails for custom post not showing up in query
- How to scroll through post thumbnails?
- Featured image in admin on custom post type
- Customized featured image doesn’t refresh in post admin metabox after upload/insert
- Retrieve post data via WPDB class
- How to Create a Frontend Html-list Editable in the Backend?
- Allow authors to create article image
- Specific Thumbnail Size for Custom Content Type
- Link to larger thumbnail in custom query (with custom post-types)
- Add Image field to CPT
- img src not working correctly in custom post type
- Add a background image into a post [closed]
- Delete old thumbnail when updating new
- Using wp_insert_post to create custom posts with ACF image field
- How to get Custom Post Type (CPT) Archive Page’s Posts Featured Images Preload in header.php