- This topic has 22 replies, 3 voices, and was last updated 7 years ago by
Tom.
-
AuthorPosts
-
March 12, 2019 at 11:19 am #836958
Dax
Thanks, Tom, looks great!
I don’t seem to be able to get the featured image sizes quite right though. I’ve tried multiple different pixel dimensions. Tried cropping them and the results seems pretty hit and miss.
What would you recommend?
Thanks
March 12, 2019 at 3:46 pm #837141Tom
Lead DeveloperLead DeveloperDid you use my PHP functions to size the images automatically? Or are you resizing them yourself?
March 12, 2019 at 5:03 pm #837176Dax
Hi Tom,
I used the PHP functions to size the images automatically.
March 13, 2019 at 8:37 am #837869Tom
Lead DeveloperLead DeveloperAnd did you run that force regenerate thumbnails plugin that I mentioned?
March 13, 2019 at 3:30 pm #838209Dax
Hi,
I ran the regenerate thumbnail plugin today, although I was notified that many images failed.
However, I remain confused because images seem to act differently e.g. are sized differently in the page hero thumbnail, even though they have the same dimensions.
For example, the featured image of these two pages appear to have the same dimensions (1024 by 512 pixels):
1.https://bit.ly/2TAMmbs – prefer this one and would be desired for the whole site.
2.https://bit.ly/2TDIBlxI have noticed that one is jpeg and the other is png format. Not sure if this makes any difference?
March 13, 2019 at 5:08 pm #838252Tom
Lead DeveloperLead DeveloperHmm, they don’t seem to be using that image size.
Just to confirm, did you add these functions with your desired size?:
add_action( 'after_setup_theme', function() { add_image_size( 'hero-image', 500, 500, true ); } ); add_filter( 'generate_hero_thumbnail_id_size', function() { return 'hero-image'; } );March 13, 2019 at 7:38 pm #838317Dax
Hi Tom,
Yes that exact code was added using the snippets plugin and I have played around with the dimensions but no changes seem to take effect when I do.
Just realized you mentioned desired image size…so what would that be for the example above?
March 14, 2019 at 8:56 am #838956Tom
Lead DeveloperLead DeveloperHmm, strange. Can you try this code instead?:
add_action( 'after_setup_theme', function() { add_image_size( 'hero-image', 500, 500, true ); add_filter( 'generate_hero_thumbnail_id_size', function() { return 'hero-image'; } ); } );The first
500is the width, and the second500is the height. That’s where you would input your own width and height depending on what you’re needing. -
AuthorPosts
- You must be logged in to reply to this topic.