• Resolved greenless

    (@greenless)


    I’m having a really hard time creating an image for the hero banners and feature image / heroes on posts & pages.

    The crop is very unpredictable. This doesn’t matter so much when using nature photography or something like that, but if I want to use photos of people, it’s nearly impossible to do because their faces are cropped out.

    Is there a way to adjust the portion of the image that will be cropped for various screen sizes? Maybe an array setting we can add to the CSS?

Viewing 5 replies - 1 through 5 (of 5 total)
  • There are several plugins that can help you modify how wordpress crops images. My personal preference is (obviously) WP SmartCrop (https://www.wpsmartcrop.com). It lets you choose a “focal point” in your image (such as a face), and generates all thumbnails in such a way as to try to keep that point close to a rule of thirds position in the image, to give you a clean, well-composed crop.

    If you get really fancy, WP SmartCrop also supports CSS softcropping, which can let you set rules for how the image should be sized on any screen size, and it will create your cropped images on the fly, to optimize for every screen.

    Thread Starter greenless

    (@greenless)

    I’m referring to the hero BG image and the ‘cover’ CSS associated with it.

    It’s unpredictable where it will crop on different screen sizes.

    Check out greenless.com and look at the hero on the homepage. Adjust the screen size in your browser and scale it in to phone size and you’ll see what I mean.

    I just want a way to tell it to align to the vertical & horizontal center.

    background-position: center center; will tell an element with background-size:cover; to crop relative to the center of the image. By changing the background position property’s value, you can tell it to crop to different positions.

    it’s still a bit janky as those values don’t map to the image center for any value other than center but with enough breakpoints, it will do the trick.

    Thread Starter greenless

    (@greenless)

    That helped a ton on my home page hero. Now I just need to figure out what is so different about the other pages. Off to a great start, though. ??

    Thread Starter greenless

    (@greenless)

    I ended up using

    background-position: top center !important;

    and it looks great.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Hero image crop adjustment’ is closed to new replies.