[Resolved] Featured image as background-size: cover in archieve posts

Home Forums Support [Resolved] Featured image as background-size: cover in archieve posts

Home Forums Support Featured image as background-size: cover in archieve posts

Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #517591
    Manuel

    Hi Tom, hi Leo,

    I want to show all featured images in the same size so the featured image fills the whole “featured image section” in archieve page (maybe background-size: cover?).
    Here’s an example from the Elementor Posts Widget:

    SCREENSHOT EXAMPLE

    Any chance to achieve this?

    Best regards and thanks in advance,
    Manuel

    #517907
    Leo
    Staff
    Customer Support

    Hi Manual,

    Without seeing what you have so far, I would say that make sure the width of the image you uploaded is wide enough to fill the featured image container, then you can crop the height so that they are all the same:
    https://docs.generatepress.com/article/adjusting-the-featured-images/

    Let me know if this helps.

    #518068
    Manuel

    Hi Leo,

    thanks for your reply.
    The width is defenetly wide enough but it doesn’t work for me. How can I crop the height without cropping the width?
    GP-1

    GP-2

    And here’s a LINK to my test site.

    At the moment the featured image size in customizer is set to auto (default)

    #518255
    Leo
    Staff
    Customer Support

    You can leave the width part blank (it would be auto) and just crop the height.

    #518342
    Manuel

    I’ve already tried but it doesn’t work.

    #518356
    Manuel

    Here’s another screenshot where I’ve set the height to 150px and the width to auto. The aspect ratio of the features image stays always the same.

    Screenshot

    What have I done wrong?

    #519271
    Tom
    Lead Developer
    Lead Developer

    That means your server is initializing the image cropping. Can you see if this helps?: https://docs.generatepress.com/article/adjusting-the-featured-images/#fix-images-not-cropping

    #519434
    Manuel

    It works. Thanks a lot for figure it out for me.

    #519837
    Tom
    Lead Developer
    Lead Developer

    No problem! 🙂

Viewing 9 posts - 1 through 9 (of 9 total)
  • You must be logged in to reply to this topic.