-
AuthorPosts
-
January 5, 2024 at 3:08 pm #1429360
Hi
I’m trying to make images object-fit: cover in magazine style, so that the images are complete squares – image below.
Are you able to assist with a bit of CSS to do this – I’ve tried replicating what you suggested for my last thread, but it just doesn’t seem to be working, and I don’t want it to affect the large logos on the left hand side – just the small thumbnails on the right hand side?
Thanks so much in advance!
January 6, 2024 at 5:33 pm #1429408on docu – you can find a possibility not to use for those images a different source :
see https://kriesi.at/documentation/enfold/magazine/ and search for: image_sizemaybe we can use the avf_magazine_defaults filter to change that. … ;)
put this to your child-theme functions.php:function avia_magazine_thumbnail($atts, $magazine){ $atts['image_size']['small'] = 'square'; return $atts; } add_filter('avf_magazine_settings', 'avia_magazine_thumbnail', 10, 2);
January 6, 2024 at 5:47 pm #1429411January 11, 2024 at 7:42 am #1429779It’s good that one can always check the corresponding pages to see if it worked. ;)
January 11, 2024 at 9:30 am #1429792Hi,
Thank you for the update.
Looks like you’ve managed to fix the issue by uploading square images (300x300px). If you still want to adjust the size of the magazine thumbnails using css, you can try this code.
.av-magazine-thumbnail-link > img { width: 100%; height: 100%; object-fit: cover; }
Best regards,
IsmaelJanuary 11, 2024 at 9:32 am #1429793Thanks for coming back to me Guenni007, and appreciate your suggestion. Because I’m not using WordPress to drive the theme/site, I was unable to use your suggestion as-is, as I couldn’t work out where to apply it directly into the CSS, but instead I’ve simply generated square thumbnail versions of the images for use in that particular section.
But, problem solved, and appreciate your time.
January 11, 2024 at 9:33 am #1429795Thank you Ismael, that’s appreciated – as you noticed I have managed to sort square thumbnails for this purpose, but thank you for the CSS to apply, and will give that a go!
January 11, 2024 at 9:40 am #1429798 -
AuthorPosts
- The topic ‘Object-fit for images in magazine style’ is closed to new replies.