Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #1479794

    Hi, how can I change the featured image size on blog posts? At the moment my image is cut off.

    #1479826

    Hey mosaic,

    Thank you for the inquiry.

    You can add this code in the functions.php file to adjust the default size of the featured image:

    function avf_customization_modify_thumb_size( $size ) {
          $size['entry_without_sidebar'] = array( 'width' => 9999, 'height' => 9999 );
          $size['entry_with_sidebar'] = array( 'width' => 9999, 'height' => 9999 );
          return $size;
    }
    
    add_filter( 'avf_modify_thumb_size', 'avf_customization_modify_thumb_size', 10, 1 );

    After adding the filter or code, you’ll have to regenerate the thumbnails or upload the images again:

    https://wordpress.org/plugins/regenerate-thumbnails/

    IMPORTANT: Please make sure to create a site backup or restore point before proceeding.

    Related thread: https://kriesi.at/support/topic/full-image-on-single-post/#post-1471379

    Best regards,
    Ismael

    #1479850

    Hi I’ve added the code, regenerated thumbnails and cleared cache but it has had no effect.

    #1479911

    Hi,
    Your image is cropped, see below.
    You could try adding this code to the end of your child theme functions.php file in Appearance ▸ Editor:

    add_filter( 'post_thumbnail_size', 'custom_single_event_post_thumbnail_size' );
    function custom_single_event_post_thumbnail_size($size) {
        if( !is_singular('post') ) {
            return;
        }
        if( ! has_post_thumbnail() ) {
            return;
        }
        $size = 'full'; 
        return $size;
    }

    otherwise we would need a login to examine.

    Best regards,
    Mike

    #1479933

    Thank you. The default option is too cropped. The full option is too large. Is there a way to make the height larger than the default option but less than the full height? So cropped but not as much as the default option.

    #1479958

    Hi,
    Try uploading a new image that is 845px-321px and remove the function above.

    Best regards,
    Mike

    #1479962

    I appreciate that I could edit a new version of every photo for every featured blog post image, but it would be far simpler and less time-consuming if I could just set the featured image size once. Is this possible? I’m very grateful that you’ve provided a code to make the image full-size, I’m hoping there is an option to set the height too?

    #1480021

    Hi,

    Try replacing “full” with “featured” (1500x430px), “featured_large” (1500x630px), or “entry_without_sidebar” (1210x430px). These are the default thumbnails registered by the theme.

    Best regards,
    Ismael

    #1480075

    That is the perfect solution, thank you

    #1480088

    Hi,

    Great! Glad we could help. Please don’t hesitate to open another thread if you have more questions. Have a nice day.

    Best regards,
    Ismael

Viewing 10 posts - 1 through 10 (of 10 total)
  • The topic ‘Blog post featured image size’ is closed to new replies.