- This topic has 22 replies, 2 voices, and was last updated 4 years, 4 months ago by
John.
-
AuthorPosts
-
November 4, 2021 at 9:38 am #1991514
John
Hello Support !
Thanks for providing above 10 Article and 10 Forums. This is great. It enables me to find answers without bothering you folks. Which means you can help others, thus making the GP-community that much better !
However, I could not find my topic. Perhaps I did not look hard enough.
If you go on http://www.understand-culture.com you’ll see that I typically have a featured image. I grab them from Unsplash, then crop them with iLoveIMG. Therein lies the problem. The image width is uniform. But not the image height.
Is there a way to define the image height so that we have uniformity across the site?
Please keep in mind that I have designed the site primarily for smartphones. So the images should not be all too high.
Thanks !
John
November 4, 2021 at 10:16 am #1991568Ying
StaffCustomer SupportHi John,
If you want the image to be the same height and same width, you can set the value at Customizing > Layout >Blog > Featured Images > Archives.
https://docs.generatepress.com/article/adjusting-the-featured-images/
But some of them will be cropped to match the height and width but keep the aspect ratio at the same time.Let me know 🙂
November 4, 2021 at 10:36 am #1991591John
Very helpful, Ying. Thank you !
A question, however: I see how to change the height. The change is immediately visible on my laptop. However, the height is different on my iPhone. Much larger.
275 px seems to be just right for viewing on my laptop, but far too large on my mobile.
Should I be in Archives- or Pages-mode? These images are on pages.
November 4, 2021 at 11:05 am #1991615Ying
StaffCustomer Supportthe height is different on my iPhone. Much larger.
The value you set in customizer is the max value. On mobile, its max width depends on the mobile screen which might be smaller than the value you set, but the height you set is not effected. We can add some CSS to make it shorter on mobile.
You can try this CSS, feel free to change the numbers.
@media (max-width: 768px) { .resize-featured-image .post-image img { width: 300px; height: 160px; object-fit: cover; }Should I be in Archives- or Pages-mode? These images are on pages.
Can you link me to the page you are talking about?
November 4, 2021 at 11:11 am #1991624John
Hi Ying,
You’re always super fast and super helpful. Thanks !
Let’s use the Patterns-page as our test:
https://understand-culture.com/patterns/November 4, 2021 at 11:17 am #1991629John
Ok. I entered the code into Additional CSS and it seems that all images on my iPhone have the identical height. Yeah !
However, on my laptop I still see differences.
November 4, 2021 at 11:19 am #1991633John
In fact, I change the height from 160 to 200 in order to see the effect. There was no differences.
November 4, 2021 at 11:19 am #1991635Ying
StaffCustomer SupportYes, so for pages featured image, set the width/height under the
Pagestab 🙂November 4, 2021 at 11:22 am #1991638Ying
StaffCustomer SupportIn fact, I change the height from 160 to 200 in order to see the effect. There was no differences.
The CSS was for archive, if we are talking about page featured images, try this CSS instead:
@media (max-width: 768px) { .page .featured-image img { width: 500px; height: 100px; object-fit: cover; } }November 4, 2021 at 11:54 am #1991661John
I set the height at 130 pm, Ying, and it looks perfect on my iPhone. And all of the images have the same height. However, there are differences still when viewing on my laptop. Is that simply a weakness of WordPress? No thing and no one is perfect !
November 4, 2021 at 12:05 pm #1991675Ying
StaffCustomer Supportthere are differences still when viewing on my laptop
Can you link me the pages that are showing differences?
No thing and no one is perfect !
The codes should be, at least they never lie 😛
November 4, 2021 at 12:44 pm #1991716John
November 4, 2021 at 12:47 pm #1991721Ying
StaffCustomer SupportIt requires a username and password to login.
I don’t need login details, just need the pages’ links 🙂
November 4, 2021 at 12:53 pm #1991727John
Oh !
You can access any of these pages via the terms:
https://understand-culture.comIs that what you mean, Ying?
November 4, 2021 at 12:53 pm #1991728John
Or should I give you admin-status?
-
AuthorPosts
- You must be logged in to reply to this topic.