Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #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?

    Thumbnails to be square

    Thanks so much in advance!

    #1429408

    on 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_size

    maybe 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);
    #1429411

    Hi,
    Thanks for sharing Guenni007

    Best regards,
    Mike

    #1429779

    It’s good that one can always check the corresponding pages to see if it worked. ;)

    #1429792

    Hi,

    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,
    Ismael

    #1429793

    Thanks 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.

    #1429795

    Thank 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!

    #1429798

    Hi!

    No problem! Please don’t hesitate to open another thread if you have more questions about the theme.

    Have a nice day.

    Regards,
    Ismael

Viewing 8 posts - 1 through 8 (of 8 total)
  • The topic ‘Object-fit for images in magazine style’ is closed to new replies.