0

I added the exact code that you offered in the post Show current page featured image in sidebar. The featured image is displayed, but the size of the image is unaltered from the original.

I am creating a child theme for "responsive", and this image is for a page, not a post. I used this code as the first thing in functions.php:

add_image_size( 'sidebar_post_thumbnail', 100, 9999, true );

When I insert the image as the featured image, my custom 100px size does not show up as a radio button. Also, I clicked the radio button for the default thumbnail size (150x150). That also had no effect.

Any ideas?

1 Answer 1

1

The size options have no effect on the featured image, those only apply when inserting an image into post content, and furthermore, you won't see custom sizes show up there, just the default, built-in ones. The size that is output in the example you linked is controlled by the call to the_post_thumbnail( 'sidebar_post_thumbnail' );

Another thing to note is that if you've added a new image size after you've already uploaded images, those new sizes won't automatically be created. you either have to re-upload the images, or use a plugin like regenerate thumbnails.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.