• Resolved themofella

    (@themofella)


    I would like to do two things with my featured images in the Twenty Sixteen theme:

    1 – Centre them
    2 – Restrict them to a specific height

    The current implementation on my site (https://mofella.com) is a vanilla Twenty Sixteen theme implementation and you will notice that the smaller featured images are left aligned and the larger ones have variable heights.

    Also, I would like to achieve this, ideally without additional plugins or using a separate graphic software. I am wondering if there is a way to crop from within my WordPress installation (quite like the customizer flow when setting up a header image), so that it fits properly.

    I am WordPress newbie, so if I have posted this to the wrong forum then would appreciate advice on the best forum to post to too.

Viewing 5 replies - 1 through 5 (of 5 total)
  • Hi themofella !

    I don’t think it has an option from the customizer but you can reach your goal using some CSS code

    go to dashboard -> Appearence -> Editor and open style.css file , then paste the following in the end

    .post-thumbnail img {
        margin: 0 auto;
        height: 300px;
    }

    In case you want to understand what the code does :

    margin: 0 auto; –> will center your images
    height: 300px; –> specify the images height so replace 300px with the value you think is good for you

    I hope this helps

    Cheers !

    Thread Starter themofella

    (@themofella)

    Thank you codeManiac. Worked like a breeze. You rock!

    wow really nice ?? thx man !

    I tried this, but it did nothing. I tried it first in my child theme, then in the parent. Nada. What am I doing wrong?

    Try this HopeSpeaking ??

    .entry-thumbnail img {
       margin: 0 auto;
       height: 300px;
    }
    • This reply was modified 8 years, 2 months ago by paljacob. Reason: added optional height limit
Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Center & Size Featured Image’ is closed to new replies.