• Resolved ClaireB1505

    (@claireb1505)


    How can I edit the code to centre align the Featured Image on the blog? Probably a simple thing but I can’t figure it out and I’m just a beginner 🙂

    thanks for your help in advance.

Viewing 6 replies - 1 through 6 (of 6 total)
  • Theme Author ThemesMatic

    (@themesmatic)

    If you mean the featured image for blog posts… ideally you would make the image large enough to be as wide at the text area so you dont have to create more work for yourself.

    Otherwise, add

    attachment-post-thumbnail {
    text-align: center;
    margin: 0 auto;
    }

    to your style.css
    that should do it.

    Thread Starter ClaireB1505

    (@claireb1505)

    Thanks for the reply. The featured images I have used are wide enough for the thumbnail but on the actual post they align left and would look better aligned central. I tried the code and it didn’t work first time – I can have a play but wondered if the action may be different for the blog post than the thumbnail? Many thanks, appreciate your help.

    Theme Author ThemesMatic

    (@themesmatic)

    So I tested it using a small image and got it to work.
    find this line of code in style.css (should be around line 717)

    .wp-post-image {
        display: block;
    }

    and change it to this

    .wp-post-image {
        display: block;
        margin: 0 auto;
    }
    Thread Starter ClaireB1505

    (@claireb1505)

    Thanks for this, however, it doesn’t work for me. I tried a number of other options but no luck. I don’t want to take up too much of your time but if you do have any other ideas it would be useful to know. Else I’ll revisit it again sometime. Many thanks again.

    Thread Starter ClaireB1505

    (@claireb1505)

    Thanks – this did work in the end – when I logged back in now I can see that it did update, just not instantly.

    Many thanks

    Theme Author ThemesMatic

    (@themesmatic)

    Awesome. Glad that worked out for you.

    If you could leave a review you would be awesome. Thanks 🙂

Viewing 6 replies - 1 through 6 (of 6 total)

The topic ‘Centre aligning featured image’ is closed to new replies.