[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 9 posts - 1 through 9 (of 9 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

    https://www.watersportswhiz.com/

    • This topic was modified 3 days, 7 hours ago by Sam.
    #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

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