Archived topic
Gutenberg Image Alignment Issue
11 replies · Started by David on November 15, 2018
Hi all,
I've been using Gutenberg in preparation for it's arrival. However in the editor when I center the image it shows centered in the editor but not when previewing or publishing.
All support forums say that image alignment issues were fixed in prior updates and that it could be theme dependent.
Any ideas?
Hi there,
You should definitely check out GP 2.2 (currently a release candidate): https://generatepress.com/generatepress-2-2/
I would need to see the page with the wrongly aligned image to know what's happening. Can you link me to it?
Hey Tom,
GP 2.2 looks amazing!!!
I added the address to the article in the original question. I just published it temporarily to show you.
The first image you will see is the one I added to a gutenberg image block. The second one is where I added an image to a classic block. Weird how the classic centers and the gutenberg doesn't eh?
David
The second image has the aligncenter class added to its container: http://prntscr.com/lix8jo
I'm not sure if that's due to the alignment setting inside the classic block?
The image block is definitely the way to go :)
Hi Tom,
I added the aligncenter class to the gutenberg container as well.. shows centered in editor but to the left when published. Any other ideas?
***Edited
Actually the image block won't let me do it. It comes back an error. Talk about frustrating lol.
Any reason why you'd want to add that class to the block?
Hi Tom,
That's a good question... I'm not sure - I was just guessing hoping it would center. :\
Any other ideas - I'm on GP 2.2.1 and the image block still will not center when you preview/publish. Just on the front end editor.
Btw, I just renewed my license for another year even though I'm not close to the deadline - thanks for the Black Friday deal!!! :)
Thanks for extending your license! :)
Have you tried the "Align Center" button when clicking on the block?: https://www.screencast.com/t/dB266E8x
Hey Tom,
Here is a screenshot with using the align center in the block and what I get when I preview or publish afterwards.

David - are you using the GB plugin or the WP 5.0 beta 5? The latter centers images frontend and backend with GP 2.2.1 for me :)
Cheers!
Lyle
Hi Lyle,
I'm running the plugin. I'm open to the idea of installing the 5.0 wordpress candidate. Is there a pretty straightforward way to do that without breaking anything? :)
Thanks for the input!
David -
Here's the plugin to install the latest nightly builds for WP 5.0. Be sure to do so on a staging/local test site though :)
https://wordpress.org/plugins/wordpress-beta-tester/
Cheers!
Lyle