[Support request] Default Centering for Image Blocks

Home Forums Support [Support request] Default Centering for Image Blocks

Home Forums Support Default Centering for Image Blocks

Viewing 12 posts - 1 through 12 (of 12 total)
  • Author
    Posts
  • #1664615
    Bruce

    For every image we add (which is hundreds in a typical week) we need to manually adjust the alignment to ‘centered’. Is there a way to have the default for an image block set to centered?

    FYI – we’re an older site that switched over to Generate Press last month. Very pleased and happy to see the Theme easily handle our 3+ million monthly pageviews.

    #1664638
    David
    Staff
    Customer Support

    Hi there,

    thats impressive stats – glad to hear your enjoying the theme!

    Any chance i can see an example post/page where there are images – just need to check the markup before offering some options.

    #1664641
    Bruce
    #1664942
    Ying
    Staff
    Customer Support

    Hi Bruce,

    You could try add this CSS, this should work for all single post pages.

    .single .wp-block-image figure {
        margin-left: auto;
        margin-right: auto;
    }

    Let me know how it goes ๐Ÿ™‚

    #1666035
    Bruce

    Sorry Ying – that didn’t seem to help. Added images at 575px remained left-justified.

    #1666062
    Leo
    Staff
    Customer Support

    Hi Bruce,

    I just checked the page and all images are centered?

    Ying’s CSS should work.

    #1666086
    Bruce

    Leo – our issue isn’t how the posts look, it’s the default image handling of wordpress that we would like to change. We have to manually center hundreds of images every week. I’m just looking for less work for my writers and editors by finding a way to change the default image block to being centered.
    Not a big deal – the process only adds a few seconds – but we look to optimize were we can. thanks

    #1666089
    Leo
    Staff
    Customer Support

    I understand. And Ying’s CSS should do exactly that.

    If it isn’t working for you, I’ll need to see a page live with the issue on it to determine why it’s not working.

    #1824839
    Chelsea

    Not to hijack someone else’s thread, but I’m having the same issue. You can see in this post, I’ve manually centered each image until the last one. The CSS isn’t centering it. https://somedayilllearn.com/bulk-food-storage/

    #1825596
    Ying
    Staff
    Customer Support

    Hi Chelsea,

    It’s much easier with a live site, so here you go:

    .single .wp-block-image > *, .single .wp-block-image .wp-block-image {
        text-align: center !important;
        margin-left: auto !important;
        margin-right: auto !important;
        display: block !important;
        float: none !important;
    }

    The CSS applies to all the single posts.

    #1830016
    Chelsea

    That did it! Thanks, Ying!

    #1830059
    Ying
    Staff
    Customer Support

    No problem ๐Ÿ™‚

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