Join the Webstudio community

Updated 3 weeks ago

Wordpress + Webstudio - Images issue

Hey guys !

Hope you’re doing well,

I’m having an issue with my Webstudio + Wordpress setup.

When I add images in Wordpress in a blog post, it displays too large on Webstudio (which affects responsive as well and have a sort of padding on the left.

From what I see, it’s because images from Wordpress are wrapped in a <figure> tag, that makes it behave incorrectly.

Example here : https://www.lokka-immo.com/blog/post/taxe-dordures-menageres-pour-les-locataires-guide-complet-2024

Everything is setup correctly in Webstudio (images style in my content embed are okay)

Any idea what’s causing the issue ? And how I can fix it ? 😅
1
J
T
J
23 comments
On the img selector in content embed you can apply max-width 100% and height auto
Hey John !

Yep, tried that already but didn't work :/
Attachment
CleanShot_2024-11-15_at_18.24.312x.png
I still have the padding left and the image Overflow and does not keep its aspect ratio when the screen size decreases
However, when I inspect the page and move the image out of the <figure> tag, the issue disappears
Attachment
CleanShot_2024-11-15_at_18.26.002x.png
You have to explicitly set auto
I would also use max-width. If you upload a 200px wide image, width: 100% will cause it to take up like 800 pixels and pixelate it
Haaa yes ! That corrected the image overflowing, cool thanks !
However, I still have this curious padding on the left, and I'm not sure where it comes from
Figure has default margin. For right now you'll need to add css that zeros it out
Attachment
image.png
Hmmm yep okay, I see what you mean
Once we develop this feature, you can create custom selectors in content embed https://github.com/webstudio-is/webstudio/issues/3265
Looking forward to this 😄
Gonna add a bit of css in the meantime
Thanks a lot John ! 🙂
eg

figure.wp-block-image {
margin: 0;
}
Try this and activate the picture tag in settings to avoid figure - the plugin is converting your images wo modern formats upon upload and lets ou use the picture tag with srcset and other stuff related to the picture tag. But it may conflict if you have bought some superexpensive image performance stuff. This one is free and by the wordpress performance team 🙂
Haaaa very interesting !

Definitely going to check this out ! Thanks for the recommendation Jacob 😁
Hey I'm just following up here. Are there steps specificially regarding the handling of these images without doing anything special within wordpress itself? I'm encountering the same issue with my articles.
Attachment
Screenshot_2024-12-19_at_17.38.21.png
I figured out a solution that works specifically for me.
Add a reply
Sign up and join the conversation on Discord