[Support request] Is it possible to show 'Medium' size image as display images on homepage?

Home Forums Support Is it possible to show 'Medium' size image as display images on homepage?

  • This topic has 1 reply, 2 voices, and was last updated 10 months ago by Tom.
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #1073474
    Shrawan

    Hi support,

    I see that the image that I choose as the ‘Featured Image’ appears on the post snippets of the front page in the original resolution (just resized, not regenerated).

    Is it possible that I can have the ‘Medium’ thumbnail generated by WordPress for the respective posts as the display image for my homepage?

    The medium thumbnail generated by WordPress (it automatically generates for every image that is uploaded) is only a fraction of the size of the original image. Any steps to make this change would be appreciated as I am looking to further shorten my loading time.

    Thanks

    #1073949
    Tom
    Lead Developer
    Lead Developer

    Hi there,

    This filter should help: https://docs.generatepress.com/article/generate_page_header_default_size/

    For example:

    add_filter( 'generate_page_header_default_size', function( $size ) {
        if ( ! is_single() ) {
            return 'medium';
        }
    
        return $size;
    } );
Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.