S
S
sendog2015-09-25 11:35:26
Images
sendog, 2015-09-25 11:35:26

How to adjust post thumbnail scaling in Wordpress?

Greetings.
Dear, I have a question.
The main page has a news feed with post thumbnails. The template is responsive.
The problem occurs when loading vertical images (book cover). They don't fit properly, sometimes they cut them to square sizes, sometimes they stretch them out normally, but still cut off the top and bottom pieces of the picture, resizing the original picture didn't help. I tried to load different image sizes, different png/jpg formats, disabling cropping in the media file settings did not help either, I tried to set the css properties to max-/min-size, - to no avail. Trouble here
What to do, tell me?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
M
Mr Crabbz, 2015-09-25
@Punkie

In functions.php:
Instead of 220 - the width, instead of 440 - the height of the picture (maximum), where false means that you don't do a forced crop. By default in WordPress, cropping is set, that is, true.
After that, install the Regenerate Thumbnails plugin, go into it and do the regeneration - this way the old thumbnails will be remade to the new size.

I
Igor Vorotnev, 2015-09-25
@HeadOnFire

Well, you have a crop height of 300px, if the picture is more than 300 - it will be cropped, if less - there will be free space on the side. This is absolutely logical behavior. Upload pictures at least 2 times larger. For vertical images, it is best to bind the crop to the width, then everything will fit into the grid in columns, and the height - as much as possible (in the settings - height = 0).

A
Afatar, 2015-09-25
@Afatar

As I see it. For your post-thumbnail class, you make specific sizes, in percentages or in pixels, as you like. And for img width=100%.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question