Site logo

[Resolved] Reduce Rendered Size of the Feature Image on Mobile (Improving LCP)

Home Forums Support [Resolved] Reduce Rendered Size of the Feature Image on Mobile (Improving LCP)

Home Forums Support Reduce Rendered Size of the Feature Image on Mobile (Improving LCP)

  • This topic has 70 replies, 3 voices, and was last updated 4 years ago by David.
Viewing 11 posts - 61 through 71 (of 71 total)
  • Author
    Posts
  • #1917607
    David
    Staff
    Customer Support

    Can’t see it on the Google PSI report, but your site is preloading the image eg. example from on of your posts:

    <link rel="preload" as="image" href="https://xxxxxxxxxxxxx/wp-content/uploads/2021/08/Rename_AzureVM_PowerShell_01.jpg">

    Do you still have the code here ? As that was added for when you had the Header Element.

    #1917636
    Charbel

    Hello @David,

    Yes, I still have the following code in my functions.php. Shall I remove it?

    /** Remove the Featured Image Background from the header element **/
    // https://generatepress.com/forums/topic/how-to-fix-largest-contentful-paint-element-for-page-hero/page/2/#post-1819584
    add_action( 'wp_head', function() {
        if( is_single() ) {
            $featured_img_url = get_the_post_thumbnail_url(get_the_ID(),'medium_large'); 
            echo '<link rel="preload" as="image" href="'.$featured_img_url.'"/>';
            echo '<style>.page-hero { background-image: url('.$featured_img_url .');}</style>';
        }		
    },0); 

    Thank You!

    #1917637
    David
    Staff
    Customer Support

    Yes, it will stop preloading the image as thats not required on Mobile now.

    #1917639
    Charbel

    Thank you @David,

    Please note that I have removed the code and cleared the cache.

    Could you please check and confirm from your side?

    Thank You!

    #1917674
    David
    Staff
    Customer Support

    I can confirm its no longer making the image request on mobile 🙂

    #1917712
    Charbel

    Many Thanks, @David much appreciated!

    I have seen a bit of improvement so far. Let’s see in the next couple of days.

    #1917917
    David
    Staff
    Customer Support

    You’re welcome

    #1942335
    Charbel

    Hello @David,

    Hope you are doing well.

    I have a small request for Mobile Menu, please.
    I changed the Hamburger icon size (left-hand side) for Mobile using the following CSS code:

    .main-navigation .menu-toggle { 
        font-size: 20px;
    }

    I would like to do the same for the Search icon on the right-hand side to increase its size a bit (from 16px to 20px), so they can be identical.

    Could you please help?

    Thank You!

    #1942772
    David
    Staff
    Customer Support

    Hi Charbel,

    would you mind raising a new topic so the question is unrelated to this one
    Will make it easier for you and us to track and respond 🙂

    #1942995
    Charbel

    Sure, thank you @David!

    #1943100
    David
    Staff
    Customer Support

    Thanks!

Viewing 11 posts - 61 through 71 (of 71 total)
  • You must be logged in to reply to this topic.