Articles of set post thumbnail size

WordPress thumbnail settings change

I have a very large WordPress image bank (over 600 images, all in use…!) and a new development will mean that i would like to change some of the thumbnail settings. I have at the moment set_post_thumbnail_size( 75, 75, true ); In the functions, which of course means that the thumbnail is cropped to fit. […]

Can't get image size set with set_post_thumbnail_size() function

I have a problem with set_post_thumbnail_size() function, which seems it doesn’t work. Or at least it doesn’t work correctly. I have set a thumbnail size 75x75px in WordPress settings under the media section and have also set another thumbnail size in the functions.php using: set_post_thumbnail_size(80, 80, true); How are these two settings supposed to work? […]

img width and height attributes being set by get_the_post_thumbnail

I’m working on a custom theme that I’ve inherited to maintain. At the top of the homepage there is a header area with some images generated by get_the_post_thumbnail. The call to get_the_post_thumbnail outputs img objects that are set to a specific width/height by their html attributes. Here’s the code and output: Inside a loop <?php […]

Featured image always rendered with 198px of height?

I added the following to my functions.php file: set_post_thumbnail_size( 500, 500); I enabled featured image (support => ‘thumbnail’) in a custom post type a created (called Page Content). When I set an image as featured image (the image I’m using has 500px of height) , the image is always rendered with 198px of height. EDIT: […]

How to remove thumbnail sizes for specific post type on a child theme?

The theme I’m using includes a slideshow that generates an additional 4 image sizes for every image that is uploaded. I don’t need to have all those images being generated for every image. Is there a way to remove the slideshow thumbnail sizes for a custom post type in my child theme? Thanks

The Thumbnail aspect Ratio Issue

I have used thumbnail like this in my wordpress theme’s one template → <?php the_post_thumbnail( ‘medium’ ); ?> In the browser it is rendering like this → <img width=”300″ height=”220″ src=”http://example.com/image-300×220.jpg” class=”attachment-medium size-medium wp-post-image” alt=”” srcset=” http://example.com/image-300×220.jpg 300w, http://example.com/image.jpg 640w” sizes=”(max-width: 300px) 100vw, 300px” > My first question is how to put height = auto […]

insert post & Upload post thumbnail from the front end using ajax

i have searched & searched for an explenation and have found some answers that seem to be working for other people on this topics but i havent been able to get working. This is my “form” <div id=”uploadPatternForm”> <div class=”rightCol fleft w30 ml2″> <h4><?php _e(‘Your Info’, ‘sagive’); ?></h4> <input type=”text” name=”senderName” id=”senderName” placeholder=”Your Name” /> […]

Setting default thumbnails size & creating multiple thumbnail sizes

Two quick questions. How does default thumbnail size work? if ( function_exists( ‘add_theme_support’ ) ) { add_theme_support( ‘post-thumbnails’); set_post_thumbnail_size( 800, 600, true ); } What does above code really mean? Does it mean all my thumbnails will be 800×600 or smaller? Because even after setting set_post_thumbnail_size get_post_thumbnail_id($post->ID) points to full-sized thumbnails (like 2500×1200). I don’t […]

WordPress loop specific thumbnail size

That’s my loop: <main id=”main”> <?php // the query $args = array(‘posts_per_page’ => 10 ); $the_query = new WP_Query( $args ); ?> <?php if ( $the_query->have_posts() ) { ?> <!– loop –> <?php while ( $the_query->have_posts() ) { $the_query->the_post(); ?> <div id=”thumbnail”> <?php if ( has_post_thumbnail() ) { the_post_thumbnail(array( “class”=>”thumbnail”)); } ?> </div> <h2><a href=”<?php […]

No srcset for hard-cropped thumbnails

I am using hard-crop on featured images like this : add_theme_support( ‘post-thumbnails’ ); set_post_thumbnail_size ( 635, 200, true ); I have no other plugin installed, not even Jetpack. No matter how large the image I upload wordpress won’t add srcset for my cropped featured images. EDIT: The problem seems to be with hard crop feature […]