Download
We're evolving to serve you better! This current forum has transitioned to read-only mode. For new discussions, support, and engagement, we've moved to GitHub Discussions.

Top-align featured image in Persona-free theme?

  • #8636
    Avatar photo[anonymous]

    Hello Publii community!

    I’m a new user, with limited coding experience and I’m trying to top-align a featured image in a post. The image looks good when previewed on the homepage, but on the actual post itself, it’s automatically center-aligned and the topmost part of the image is cut off on most screen sizes.

    I’ve tried to play around with a theme override but I’m afraid my CSS editing attempts have failed me so far..

    Is there anyone who can help assist so that I can top-align a featured image in a post?

    Thank you!
    Curtis

    #8638
    Avatar photo[anonymous]

    To top-align the featured image in a post, you could try adding the following to “Custom CSS”

    .post__featured-image img {
      object-position: top;
    }

    Cheers

    #8639
    Avatar photo[anonymous]

    Yes that’s it! So simple! Only problem is that I only want it for one or two selected posts – is it possible to make this adjustment for just a few posts?

    Btw I’ve just purchased the Persona theme, thank you for the support.

    Curtis

    #8647
    Avatar photo[anonymous]
    [anonymous] wrote:

    Only problem is that I only want it for one or two selected posts – is it possible to make this adjustment for just a few posts?

    Indeed, the custom CSS statement would be across the entire site.  If you need to target selected posts, some work needs to be done on the post.hbs file.

    I am also a user with limited CSS knowledge.  Perhaps the moderators or other members can propose a more detailed solution.

    #8674
    Avatar photo[anonymous]

    Thanks Shaun, hoping that others can steer me in the right direction to provide an option for top-aligning featured images on select posts in the Persona premium theme!