[Resolved] Featured image show lazy and first image of post not lazy in generepress premium

Home Forums Support [Resolved] Featured image show lazy and first image of post not lazy in generepress premium

Home Forums Support Featured image show lazy and first image of post not lazy in generepress premium

  • This topic has 10 replies, 4 voices, and was last updated 1 month ago by Diogenes.
Viewing 11 posts - 1 through 11 (of 11 total)
  • Author
    Posts
  • #2277301
    Diogenes

    Hello.

    Does generatepress premium have any function to remove the lazy load from the first image of the post? Or wordpress added this function recently?

    I ask because of the following:

    When I have the basic generatepress theme (without generatepress premium), the first image (featured) is not shown lazy and the other images of the post are shown lazy.

    When I enable generatepress premium, the featured image is displayed lazy and the first image of the post is not displayed lazy (other images within the post are displayed lazy).

    This behavior is strange, and I consider that the featured image is not displayed lazy and the others are, it is appropriate and desired.

    Is there an error in generatepress premium? Or is this behavior normal and expected?

    I leave you the link of the page where I have done these tests, this one has only generatepress premium enabled, without any other plugin, without any cache plugin, without code added to functions.php or elements.

    I would appreciate the help.

    #2277567
    Diogenes

    can you help me with this?

    #2277686
    Scott

    If your first image is within the viewport above the “fold” it will be loaded with the tags as normal. This is pretty common and expected behavior. PageSpeed Insights, GT Metrix and most other performance metric tools will specifically tell you it isn’t good to lazy load above the fold.

    And yes WordPress has a built in lazy load “feature”.

    Here’s a good reference resource:

    https://web.dev/lazy-loading-best-practices/

    #2277695
    David
    Staff
    Customer Support

    Hi there,

    thats odd, as unless you have enabled a different featured image location with GP Premium then the markup and presumably the Above the Fold position of the image is the same as it is in the free theme.

    Neither the Theme or GP Premium adds any code to change that.

    Is it possible to see the site with GP Premium disabled ?

    #2277975
    Diogenes

    Hi David, thanks for replying.

    I already disabled gp premium so you can see it.

    In the image below you can see how the featured image is configured in gp premium, there is no additional code in it.

    This happens on all my websites with gp premium.

    If you wish, I can give you access as an administrator to that wordpress if you want to go deeper. It is a test website nothing more.

    #2278340
    David
    Staff
    Customer Support

    Thanks for reporting this, we’ll do some testing and see whats going on there.
    Could be a bug, or recent change in WP that we haven’t picked up.

    If you could provide a temporary admin login – it would be much appreciated

    Get back to you soon

    #2278399
    Diogenes

    I leave you the access data in the private information of this replica.

    I would appreciate if you tell me if it was a bug or something I’m doing wrong.

    #2278923
    Tom
    Lead Developer
    Lead Developer

    Hi there,

    I can’t think of anything in GP Premium that would do this.

    I actually dug into WP core when I built the Image block in GenerateBlocks to see how they add the lazy loading attributes.

    You can see here they look for the wp-image-xx class, which your image has: https://github.com/WordPress/wordpress-develop/blob/5650aa623c60ba224130b7820d38f1e69d583bce/src/wp-includes/media.php#L1799

    What happens if you deactivate all of the GPP modules? Any difference?

    #2279205
    Diogenes

    Hi tom.

    If I disable all the premium GP modules it works correctly (featured image without lazy and first image lazy), the problem seems to be in the GPP Blog module.

    If I activate it, the featured image makes it lazy and the first image of the post without lazy.

    In fact, create a new wordpress from scratch without installing or changing anything from the default installation (no plugins, themes or code). In it I only put: generatepress theme, generatepress child theme, GP premium, activate only the Blog module and the same thing happens.

    I leave you in the Private Information of this replica the access data as administrator to this new website, as well as the example post where I put the images. It is a test website so you can make the changes you need in it.

    I appreciate the help given.

    #2280968
    Tom
    Lead Developer
    Lead Developer

    Thanks for that! I’ve been able to replicate the bug and have logged it to be fixed in 2.2.0 🙂

    #2281756
    Diogenes

    I’m glad you managed to replicate it.
    I’m waiting for the patch.
    Greetings.

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