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

Set the Gutenberg editor width in the WP Admin Dashboard to full width

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

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

古腾堡编辑器宽度

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

古腾堡编辑器宽度

Implementation Method

We can directly insert the following code intoTheme's functions file:

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

function editor_full_width_gutenberg() {
echo '';
}

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

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

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

「Naibabiji WordPress Website Building Coaching」 — From selecting a domain and purchasing hosting to installing themes and publishing posts, I「ll guide you through every step, helping you avoid detours and reach your goals directly.

👉 Learn about 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 to Follow