How to disable multiple thumbnail generation?

You can disable the medium and large image sizes by using the ‘intermediate_image_sizes’ filter: function remove_image_sizes($image_sizes){ foreach($image_sizes as $key => $size){ if($size == ‘large’ || $size == ‘medium’) unset($image_sizes[$key]); } return $image_sizes; } add_filter(‘intermediate_image_sizes’, ‘remove_image_sizes’, 12, 1); This skips adding these sizes and the options to insert a medium/large image are left blank in the … Read more

WP 3.4 has missing photo data

Having figured out the issue, I’d like to update this question. The issue stems from previous versions of WP not including the _wp_attached_file meta key when uploading media, which 3.4 now seems to require. Below is PHP code for looping through the database, verifying the presence of both the key and image file, then updating … Read more

Thumbnail and Featured Image With Fixed Sizes?

For this situation, you should use add_image_size. You can find more info about it in the codex. What add_image_size does is register new sizes for your thumbnails, so you can use them with the_post_thumbnail (and other functions). Here´s the example from the codex: if ( function_exists( ‘add_image_size’ ) ) { add_image_size( ‘category-thumb’, 300, 9999 ); … Read more

Underscores.me retrieve next / previous post thumbnail in post_nav function

I solved the problem by using get_the_post_thumbnail() instead of the variables $prevthumbnail and $nextthumbnail. function THEMENAME_post_nav() { // Don’t print empty markup if there’s nowhere to navigate. $previous = ( is_attachment() ) ? get_post( get_post()->post_parent ) : get_adjacent_post( false, ”, true ); $next = get_adjacent_post( false, ”, false ); if ( ! $next && ! … Read more

Custom image sizes only for thumbnails

https://github.com/crstauf/WordPress-FeaturedImage-SpecialImageSize try this out; wrote it myself a long time ago. I do have an updated version, coming out soon. let me know if you’ve any questions. as requested, relevant code for functions.php of your theme: // `post_type` => array(width,height,crop) $featimg_sizes = array( ‘post’ => array(50,20,false) ); add_action(‘wp_ajax_set-post-thumbnail’,’generate_featimg_size’,1); function generate_featimg_size() { global $featimg_sizes; $thumbnail_id = … Read more

Cannot get full thumbnail size using the_post_thumbnail

Try to add custom thumbnail size with unlimited(very big) hegiht and width in functions.php with following code: add_theme_support( ‘post-thumbnails’ ); add_image_size( ‘custom’, 9999, 9999 ); It will not crop any images. So you can use it as the_post_thumbnail( ‘custom’ ); This method looks rough but you can use if other ways don’t work. And if … Read more

Media thumbnail for custom post inside post content

@Ibraheem, you don’t have to use global $post, since it is in global. To check post type you can use get_post_type(). Using the_post_thumbnail is not properly implemented in this case, instead use get_the_post_thumbnail. Note: you can’t use has_post_thumbnail as tag condition if you are not set featured image. add_filter( ‘the_content’, ‘put_thumbnail_in_posting’ ); function put_thumbnail_in_posting( $content … Read more