• I am a bit confused. It seems the theme sets the thumbnail size to 372 x 672 – which is a very odd thing to do and this overrides the size set within Media. Mostly, it’s not a problem, BUT, for the featured content display on the first page – the images are cropped, not resized. The entire width is 672, so the width is being readjusted to 224, but the height is just cropped, resulting in really ugly pix for the featured content.

    Can I correct this somehow?

    The page I need help with: [log in to see the link]

Viewing 1 replies (of 1 total)
  • Hi,
    Your issue can be broken down into two parts – 1) Resized and 2) Responsiveness.

    1) Themes generally use some specific pre-defined dimensions to display images on web pages. However, you can create your own thumbnail size according to your requirement.

    The following article should give you a good idea about how it works.

    http://www.wpbeginner.com/wp-tutorials/how-to-create-additional-image-sizes-in-wordpress/

    2) Responsiveness: This feature is controlled by CSS Media Queries. By responsiveness we mean elements with ability to adjust its dimension according to the width of device you are using to view your website. If your theme supports responsive layout it should take care of this automatically unless your images have inline width and height attributes. In order to accomplish the responsive behavior you need to make sure no hard coded dimension gets gendered with images. For this add the following code in your theme’s functions.php file:

    function remove_image_size_attributes( $html ) {
        return preg_replace( '/(width|height)="\d*"/', '', $html );
    }
     
    // Remove image size attributes from post thumbnails
    add_filter( 'post_thumbnail_html', 'remove_image_size_attributes' );
     
    // Remove image size attributes from images added to a WordPress post
    add_filter( 'image_send_to_editor', 'remove_image_size_attributes' );

    Let me know if this helps you.

Viewing 1 replies (of 1 total)
  • The topic ‘Featured Images Not Responsive’ is closed to new replies.