[Support request] The theme is not generating any thumbnails

Home Forums Support [Support request] The theme is not generating any thumbnails

Home Forums Support The theme is not generating any thumbnails

Viewing 11 posts - 16 through 26 (of 26 total)
  • Author
    Posts
  • #1369603
    David
    Staff
    Customer Support

    The function i provided here should add the no-lazy class to the featured image. But it is not which means something else is changing the img html.

    Do you have any other functions that are related to Images ?

    #1370101
    Shrawan

    No David, don’t think so. We have not added anything other that what you have recommended on the 5th of February on this thread.

    #1370414
    David
    Staff
    Customer Support

    Do you still have this code here?
    https://generatepress.com/forums/topic/the-theme-is-not-generating-any-thumbnails/#post-1157575

    If so can you temporarily remove that and let us know.

    #1395848
    Shrawan

    I have added the code you gave me, excluded the old code (As you advised) but I still see the same single LCP issue

    #1397313
    David
    Staff
    Customer Support

    I can see the class is being added to the img on your single post. And it is no longer subject to the Lazyloader. I ran a lighthouse report and the CLS was 0

    On the front page the CLS is very little – but all of the elements listed are fonts. And you can see a slight FOUT when loading. This will be related to your font loading and any optimizations you’re using for them.

    #1399171
    Shrawan

    Hi David, the issue is with LCP, not CLS – when you run the GooglePageSpeed test on the homepage, we have the LCP as one of the issues which need correction, which is why I opened this ticket.

    #1399229
    David
    Staff
    Customer Support

    The lazy loader is affecting the the first post image which is your largest element.
    Try adding this function:

    function db_add_class_to_first_in_loop_featured_image($attr) {
        remove_filter('wp_get_attachment_image_attributes','db_add_class_to_single_featured_image');
        global $wp_query;
        if ( !is_single() && 0 == $wp_query->current_post  )
            
            $attr['class'] .= ' skip-lazy';
    
        return $attr;
    }
    add_filter('wp_get_attachment_image_attributes','db_add_class_to_first_in_loop_featured_image'); 

    It should add the skip-lazy class to the featured image of the first post.

    #1399236
    Shrawan

    David we’ll add what you’ve given us, but should we first disable what you already gave us here? – https://generatepress.com/forums/topic/the-theme-is-not-generating-any-thumbnails/#post-1157575

    #1399251
    David
    Staff
    Customer Support

    The previous code i gave you fixed the Single Posts issue. So you need to keep that as well.

    #1399256
    Shrawan

    Hi David, not sure what you are referring to – the GooglePageSpeed test for single post still has the LCP issue, despite us adding your code.

    #1399274
    David
    Staff
    Customer Support

    FCP measures the time taken to display the first pixel.
    LCP is the time it takes for the largest element to be displayed.
    On your single post you will see there is 1. Largest Contentful Paint element
    This is the featured image.

    This is not an Error – all it is telling you is the LCP time is based on HOW LONG that element took to load.

    The first code i gave you stopped it from being lazy loaded. Which means is should have a lower LCP and also the user doesn’t see an empty white space when it first loads.

    The second code i gave you will do the exact same thing for the first post in your loop.

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