We're merging with GenerateBlocks! Learn more here.

[Support request] Google Page Speed Warning – Image elements do not have explicit width and height

Please login to receive premium support.

Support for the free plugin can be found here.

Home Forums Pro Support Google Page Speed Warning – Image elements do not have explicit width and height

Viewing 12 posts - 1 through 12 (of 12 total)
  • Author
    Posts
  • #27232
    Sam
    Participant

    Hi

    I use WPSHOWPOST for post archives on my home page and within the sidebar widget.

    I am currently looking to optimise my page speed metrics ahead of Mays mobile first roll out

    I am receiving the following warning when running a page speed audit within google

    Image elements do not have explicit width and height

    The warning relates to any page of post where a WPSHOWPOST tile is being displayed.

    I not sure what the issue is or how to solve – especially as the image size is being set with WPSHOWPOST item

    Have done something wrong? if so, how can I correct it – my technical skills are limited (learning everyday), so might need to spell it out.

    Regards

    Sam

    [URL redacted by request of the user]

    #27272
    elvin
    Moderator
    #27289
    Sam
    Participant

    Hi Elvin

    I tried the suggested CSS but got the same funky results. Straight margins etc

    I have two different size tiles.

    One on my home page (hot off the press), the other for my recent post and popular posts sidebar widget (shown on posts)

    My CCS is limited so might need a helping hand

    Thanks

    Sam

    #27291
    elvin
    Moderator

    Can you link us to the site in question to check? You can send us the link on our contact page if you prefer it to be private.
    https://wpshowposts.com/contact/

    #27307
    Sam
    Participant

    Message Sent

    #27337
    elvin
    Moderator

    Try adding this for the home page:

    #wpsp-1507814 .wp-show-posts-image img {
        height: 100% !important;
    }
    #wpsp-1507814 .wp-show-posts-image {
        height: 228px !important;
    }

    As for the sidebar:

    #wpsp-1508078 .wp-show-posts-image img, #wpsp-1508070 .wp-show-posts-image img {
        height: 100% !important;
    }
    #wpsp-1508078 .wp-show-posts-image, #wpsp-1508070 .wp-show-posts-image {
        height: 200px !important;
    }

    I purposely didn’t add width to keep it responsive(100% of container).

    #27361
    Sam
    Participant

    Hi Elvin

    Thanks for this – this has stopped the PSI warning.

    However, I how have a warning about property sized images.

    The post images are taken from my post feature image – which is a full width hero header (so 1500px ish)

    I thought SVC function should swap these in the browser for a smaller size – is there a way for setting them to use medium or medium-large.

    In a similar way as the blog setting in Gen-press theme customizer

    #27389
    elvin
    Moderator

    However, I how have a warning about property sized images.

    The post images are taken from my post feature image – which is a full width hero header (so 1500px ish)

    Yeah this is actually a known issue of the current official version (1.1.3).

    We actually have an update about it but its still in alpha version.
    https://wpshowposts.com/wp-show-posts-1-2-0/

    It’s this particular feature: https://share.getcloudapp.com/E0u9X6q1

    Which allows you to pick the image used so the list doesn’t use unnecessarily huge files for its images.

    #27414
    Sam
    Participant

    Ok – at least I know there is something in the pipe line

    Is there a date when this will be moved to beta then full release – Appreciate that Tom and team have their hands full with GP2.0

    #27486
    elvin
    Moderator

    Tom mentioned about moving 1.2.0 into beta this March but he didn’t mention any specific date.

    We’ll make sure to announce once it’s up. Announcements are found here: https://wpshowposts.com/category/development/

    #27512
    Sam
    Participant

    Any chance you can remove my URL from the first post – Thanks

    #27538
    elvin
    Moderator

    Done.

    Update: Tom mentioned yesterday that he’s planning to move WPSP into beta next week. 🙂

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