• ALL of my Button Blocks will only align left. I recently updated my plugins.

    When I went back in to my website I found that all of my button blocks had moved from ALIGN CENTRE to ALIGN LEFT. I attempted to update them back by clicking on ALIGN CENTRE but the system ignores my request.

    Can you help?

    Andy

    The page I need help with: [log in to see the link]

Viewing 1 replies (of 1 total)
  • Hi Andy,
    Did you first notice this issue after update to WordPress 5.7? The button alignment bug that you are reporting appears to be due to a styling issue for legacy button blocks that was introduced in Gutenberg 9.3 and included in WordPress core 5.7. There is a bugfix in place to correct this issue for Gutenberg 10.5, however I’m not sure when this version of Gutenberg will be released.

    I would keep an eye out for upcoming WordPress core updates, but in the meantime you can 1. replace the buttons with new button blocks — only legacy button blocks are affected; if you use the updated buttons block, then center alignment should work correctly, or 2. apply inline styles to center your Gutenberg button blocks. For example, to center the buttons on your Tours page (https://edinburghcabtours.com/tours/) with inline styes, open the the Gutenberg editor for the Tours page, and:
    1. Ensure that align center is selected for the button block
    2. On the button block, Select the More Options (three vertical dots)
    3. Select Edit as HTML

    You will then see something like this:
    <div class="wp-block-button aligncenter is-style-circular"><a class="wp-block-button__link has-quaternary-color has-text-color has-background" href="https://edinburghcabtours.com/tours/city-centre-tour-2-hours/" style="background-color:#1b2dd0">read more</a></div>

    You will want to add style="text-align:center;" to any button div that you would like centered. The Tour page buttons block html should look like this:

    <div class="wp-block-button aligncenter is-style-circular" style="text-align: center;"><a class="wp-block-button__link has-quaternary-color has-text-color has-background" href="https://edinburghcabtours.com/tours/city-centre-tour-2-hours/" style="background-color:#1b2dd0">read more</a></div>

    Once Gutenberg 10.5 is release you can remove this inline style fix. Let me know how that works out for you!

Viewing 1 replies (of 1 total)
  • The topic ‘WordPress Button Block – Only Aligns Left’ is closed to new replies.