[Support request] Featured images for home page & post page

Home Forums Support [Support request] Featured images for home page & post page

Home Forums Support Featured images for home page & post page

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #2331073
    Kathy

    Hi! I have my newest blog posts fed into my homepage and I have warnings on them all that the image is too large for the container.

    But if I resize them for the home page containers, then they show up too small to be a featured image on the post page.

    Is there way to have a posts featured image sized for the home page, as well as the post page.

    http://craftychica.com

    Thanks for any help!

    #2331086
    Fernando
    Customer Support

    Hi Kathy,

    May I first ask where you’re getting the warnings?

    #2331098
    Kathy

    Smush Pro! They put a little yellow frame around my images that need attention then it tells the size they are and the size of the container. And it says I should resize them to fit in the container.

    #2331105
    Fernando
    Customer Support

    I see.

    Can you try resizing them using this filter and see if that works?: https://docs.generatepress.com/article/adjusting-the-featured-images/#changing-the-featured-image-sizes-using-a-filter

    For instance:

    add_filter( 'generate_blog_image_attributes', function( $atts ) {
        if ( is_home() ) {
            $atts[ 'width' ] = 300;
            $atts[ 'height' ] = 300;
            $atts[ 'crop' ] = true;
        }
    
        // Return our options
        return $atts;
    } );

    Adding PHP reference: https://docs.generatepress.com/article/adding-php/#code-snippets

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.