Hero section image problem

This topic contains 10 replies, has 2 voices, and was last updated by  Jakub Bereta 4 years, 2 months ago.

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket
  • Author
    Posts
  • #529471

    Jakub Bereta
    Expired Member
    Post count: 23

    Hey,

    I have another problem. I’m adding images to Hero section (correct name?). The same image, on home page is in very good quality. When i’m going for example to “Add listing” page, this image is pixelized and in low quality. Image size is really big, so i don’t know what is compressing my images.

    #529476

    Kor
    Moderator
    Post count: 16516

    Hi Jakub Bereta,

    Thanks for your post. The image is not compressing but instead, it’s trying to fill the entire header section of the page. We can force it to not stretch the image using custom CSS but you might not like the result. Could you share the URL of the page in question?

    #529486

    Jakub Bereta
    Expired Member
    Post count: 23

    Ahh sorry. My mistake
    https://forourkids.pl/index.php/dodaj-atrakcje-lokalne/?listing_type=gd_place

    So, maybe i should prepare photos in another resolution?

    #529563

    Kor
    Moderator
    Post count: 16516

    Hi Jakub,

    Thanks for your reply. Could you try using the custom CSS code below and see if it helps? Insert into WP > Appearance > Customize > Additional CSS.

    .hero-section .custom-header-media iframe, .hero-section .custom-header-media img, .hero-section .custom-header-media video {
        object-fit: contain;
    }
    #529857

    Jakub Bereta
    Expired Member
    Post count: 23

    Not at all. See attachement.

    What’s interesting, the same photo on the main page is in very good quality, and on other sites is in terrible quality. I think that system is scaling hero images. This photo in attachement is 2762×508 px so it can’t be that small.

    #529924

    Kor
    Moderator
    Post count: 16516

    Hi Jakub Bereta,

    Thanks for your reply. Could you adjust the media size as explained here https://wpgeodirectory.com/docs-v2/design/images/#intro and see if it helps? If not, share your Website WP admin access here in private reply and we’ll check this out for you.

    #529926

    Jakub Bereta
    Expired Member
    Post count: 23
    This reply has been marked as private.
    #530019

    Kor
    Moderator
    Post count: 16516

    Hi jakub,

    Thanks for your reply. If you insert this custom CSS code below, you’ll see the entire image with good resolution. Since the height is so limited, could you tell me what are you trying to achieve?

    div#wp-custom-header {height: 500px;}
    #530484

    Jakub Bereta
    Expired Member
    Post count: 23

    Hello,

    I wan’t to achieve really simple thing – to have Hero images in good quality.

    Please look at this page:
    https://forourkids.pl/index.php/opiekunki/

    The hero image is in really bad quality. And i completely doesn’t know why.

    #530712

    Kor
    Moderator
    Post count: 16516

    Hi Jakub,

    Thanks for your patience. I’ve applied the PHP code below to remove srcset and could you check and see if it looks correctly now?

    add_filter('wp_get_attachment_image_attributes', function($attr) {
        if (isset($attr['sizes'])) unset($attr['sizes']);
        if (isset($attr['srcset'])) unset($attr['srcset']);
        return $attr;
    }, PHP_INT_MAX);
    add_filter('wp_calculate_image_sizes', '__return_false', PHP_INT_MAX);
    add_filter('wp_calculate_image_srcset', '__return_false', PHP_INT_MAX);
    remove_filter('the_content', 'wp_make_content_images_responsive');
    #531064

    Jakub Bereta
    Expired Member
    Post count: 23

    Yes! Now it looks perfectly! Thanks a lot !

Viewing 11 posts - 1 through 11 (of 11 total)

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket