Sign in

Top-align featured image in Persona-free theme?

  • This topic has 4 replies, 2 voices, and was last updated 1 month ago by .
Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #8636
    Avatar photocmacsound

    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 photoshaun2k

    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 photocmacsound

    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 photoshaun2k

    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 photocmacsound

    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!

     

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