🚀 Is building a website too difficult? Let me guide you step by step—Learn about the 「Naibabiji WordPress Website Building Coaching Service」 →

Set the WordPress Backend Gutenberg Editor Width to Full Width

WordPress, in its newer versions, enables the Gutenberg editor by default. However, when writing articles in the backend, the Gutenberg editor's width is fixed and very narrow, which is not very convenient. Therefore, we can use CSS code to make the Gutenberg editor display at full width (adjusting according to the browser window size).

By default, if the Gutenberg editor width is not set, the editing window when writing articles in the backend is only as small as shown in the image below, which is very obstructive.

古腾堡编辑器宽度

After modifying it with CSS code and setting it to adapt its width according to the browser window size, the view becomes much more open. As shown in the image below:

古腾堡编辑器宽度

Implementation Method

We can directlytheme's functions.php fileinsert the following code inside:

/**
* 设置古腾堡编辑器显示宽度为全宽
*/
add_action('admin_head', 'editor_full_width_gutenberg');

function editor_full_width_gutenberg() {
echo '<style>
body.gutenberg-editor-page .editor-post-title__block, body.gutenberg-editor-page .editor-default-block-appender, body.gutenberg-editor-page .editor-block-list__block {
max-width: none !important;
}
.block-editor__container .wp-block {
max-width: none !important;
}
</style>';
}

If you don't know how to add it, you can use:

You can also install the pluginEditor Full Width Gutenbergto achieve this (the above code is copied from this plugin).

🚀 Still feeling confused after reading the tutorial? Let me guide you step-by-step.

「Naibabiji WordPress Website Building Coaching Service」—From choosing a domain and buying hosting, to installing a Theme and publishing content, I「ll coach you through every step, helping you avoid detours and reach your goal directly.

👉 Learn about the Website Building Coaching Service
🔒

Comments are closed

The comment function for this article is closed. If you have any questions, please feel free to contact us through other channels.

×
二维码

Scan QR Code to Follow

AI Website Building Assistant

🤖
Hello! I am the Naibabiji AI Assistant. How can I help you?
Quick Consultation: