Site logo

Archived topic

GPP 2.0 - Featured image height issues

5 replies · Started by George on April 18, 2021

Viewing posts 1–6 of 6

I currently have a block element as a Content Template with a dynamic image block as a featured image along with title and excerpt and displaying it as a grid through the Customizer settings. I use that template for all category archives. I want to reduce the image height so that it's the same for all posts in the grid by setting the Image height of the dynamic featured image to a set number. The image height on the front end though, doesn't seem to be affected. I was under the impression that GPP 2.0 would be able to sort that issue once and for all with images of varying sizes but I must be missing something.

Hi George,

WordPress doesn't have a way to resize images on the fly like this. Our width/height attributes will add your values as the values in the HTML, but the actual size of the image depends on the "Size" option.

If you need a cropped size, you need to tell WordPress to generate a new size: https://docs.generatepress.com/article/adding-image-sizes/

I thought so. Great, thanks Tom! So basically the image width and height attributes in the content template are useless? Because even if you ignore them, there are still some values in the front-end.

I wouldn't say useless. Say you choose a size that's 1024x1024 but you want to display it at 50% for retina displays. You can set the width/height to 512. Those values control the width/height attributes of the HTML element.

Ah, I see, makes sense. Thanks, Tom!

No problem!

This archived topic is closed to new replies.