Archived topic
Block Editor Width
7 replies · Started by Math on February 1, 2022
Hi,
After today's update (GeneratePress 3.1.2) the block editor is now displaying the post content in (almost) full width. Previously, it was contained and you could tell the difference between full width and contained widths.
The actual post when Previewing or Publishing works as intended. It's only in the editor.
Why was it changed?
Thank you.
Hi there,
WP 5.9 stopped the Full Width block options being displayed in the Post Editor. Which was patched in 3.1.2.
So the only change should be related to blocks with that option selected.
Are you seeing a change elsewhere ?
Hi David,
On one site I updated to the latest WP 5.9 and latest GP 3.1.2, and everything is showing up full width in Post. See below.
https://www.dropbox.com/s/cp7t2mihvha5htu/Capture.PNG?dl=0
On the other site, I updated to the latest WP 5.9, but didn't update to the latest GP and the Post width is contained as it had been previously. See below.
https://www.dropbox.com/s/qqdaxvo9rqkez5g/Capture2.PNG?dl=0
Thank you.
Would it be possible to get temporary admin access to the problem site so we can take a look ?
Login info provided.
Hi there,
Sorry about this - looks like a bug when setting the content width in a Layout Element and our 3.1.2 update.
As a quick fix until we release 3.1.3, you can do this:
add_action( 'enqueue_block_editor_assets', function() {
global $generate_elements;
foreach ( $generate_elements as $element ) {
if ( 'layout' === $element['type'] ) {
$content_width = get_post_meta( $element['id'], '_generate_content_width', true );
if ( $content_width ) {
$admin_css = 'body .wp-block{max-width: ' . absint( $content_width ) . 'px !important;}';
wp_add_inline_style( 'generate-block-editor-styles', $admin_css );
}
}
}
}, 100 );
Let me know if that works or not :)
Hi Tom,
Seems to be working. Thanks for addressing this issue quickly!
No problem - sorry for the inconvenience!