Home › Forums › Pro Support › Google Page Speed Warning – Image elements do not have explicit width and height
- This topic has 11 replies, 2 voices, and was last updated 2 years, 7 months ago by
elvin.
-
AuthorPosts
-
February 23, 2021 at 7:41 am #27232
Sam
ParticipantHi
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]
February 23, 2021 at 6:16 pm #27272elvin
ModeratorHi there,
Try my reply here:
https://wpshowposts.com/support/topic/width-height-psi-warning/#post-27115February 24, 2021 at 12:19 am #27289Sam
ParticipantHi 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
February 24, 2021 at 12:21 am #27291elvin
ModeratorCan 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/February 24, 2021 at 5:28 am #27307Sam
ParticipantMessage Sent
February 24, 2021 at 8:43 pm #27337elvin
ModeratorTry 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).
February 25, 2021 at 10:27 am #27361Sam
ParticipantHi 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
February 25, 2021 at 6:49 pm #27389elvin
ModeratorHowever, 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.
February 26, 2021 at 2:54 am #27414Sam
ParticipantOk – 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
February 28, 2021 at 8:49 pm #27486elvin
ModeratorTom 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/
March 1, 2021 at 10:16 am #27512Sam
ParticipantAny chance you can remove my URL from the first post – Thanks
March 1, 2021 at 6:58 pm #27538elvin
ModeratorDone.
Update: Tom mentioned yesterday that he’s planning to move WPSP into beta next week. 🙂
-
AuthorPosts
- You must be logged in to reply to this topic.