Gutenberg Editor

How to add the Gutenberg Editor to WooCommerce

Want to add Gutenberg editor to WooCommerce,但不确定如何操作?你来对地方了!

默认的 WooCommerce 编辑器使用经典的 WordPress 编辑器在您的电子商务网站上添加或编辑产品

This may not allow you to create intuitive product pages in WordPress,Because the default editor has very limited functionality and customization settings。

therefore,You may be interested in using the Gutenberg editor,Because it provides a powerful yet simple user interface to edit your product pages。

With extensive customization capabilities,It gives you more control over the look and feel of your website,and can easily design your e-commerce store using its drag-and-drop builder。

but,WooCommerce does not have any built-in support for Gutenberg。That is to say,There are some easy ways to add Gutenberg to WooCommerce and start building engaging websites。

in the text,我们将探讨如何在 WordPress 中为 WooCommerce 启用 Gutenberg 编辑器的不同方法

为什么要在 WooCommerce 产品页面中使用 Gutenberg 编辑器?

将 Gutenberg 编辑器添加到 WooCommerce 是简化您的网站设计和编辑体验的好方法

Gutenberg 编辑器具有直观的拖放编辑器和独特的块可让您向产品页面添加文本图像和自定义设置

使用 WooCommerce Gutenberg 编辑器您可以使用不同的设计元素来创建吸引人的产品描述修改设计布局以及使您的单个产品页面设计与您的品牌保持一致

刚到古腾堡?通过此 WordPress 块编辑器初学者指南了解有关什么是古腾堡的所有信息

如何将古腾堡编辑器添加到WooCommerce?

如果您习惯于使用 Gutenberg 编辑器那么使用经典的 WordPress 编辑器设计您的 WooCommerce 产品页面可能会令人困惑

but,您可以通过使用插件或Functions.php文件向您的网站添加一些代码片段来为 WooCommerce 启用 Gutenberg

让我们详细探讨这两种方法-

Method 1:使用 Code Snippets插件

将 Gutenberg 编辑器添加到 WooCommerce 的最简单方法是使用一个名为 Code Snippets 的插件方法如下

No. 1 step:安装 Code Snippets 插件

在您的 WordPress 仪表板上转到Plugins > Add New 并查找 Code Snippets安装并激活插件

如何将古腾堡编辑器添加到 WooCommerce

No. 2 step:添加代码片段

在仪表板上导航到Snippets > All Snippets > Add New。

在此处添加新的代码段名称并将以下代码复制并粘贴到代码段的“代码”部分中

确保在底部启用Run Snippet Everywhereand save changes。这会将古腾堡添加到您的网站的 WooCommerce 中

如何将古腾堡编辑器添加到 WooCommerce

No. 3 step:检查您的产品页面

at last,您必须检查并验证您添加的代码是否正常工作。to this end,请转到“产品”并选择现有产品或添加新产品

如何将古腾堡编辑器添加到 WooCommerce

您应该能够在 WooCommerce 页面上使用 Gutenberg 编辑器一切顺利!

方法 2:使用Functions.php文件

您还可以向主题文件添加代码以创建您的 WooCommerce Gutenberg 产品页面

虽然不建议使用此方法因为当您更新主题时代码可能会丢失或者如果代码有微小的放错位置您的网站可能会中断

therefore,只有在您习惯于直接添加代码时才尝试此方法

to this end,请转到 WordPress 仪表板上的Appearance > 主题编辑器

找到您当前主题的functions.php文件并将上面给出的代码粘贴到functions.php文件的末尾

如何将古腾堡编辑器添加到 WooCommerce

also,建议在继续使用此方法之前使用子主题并备份您的网站因为即使是一个错误也会破坏您的网站

如何将经典产品描述转换为块

如果您已经使用旧的 WordPress 编辑器将一些产品添加到您的 WooCommerce 商店

您需要将现有内容转换为块才能使用 Gutenberg 块编辑器来编辑内容

在编辑器中您会发现现有产品内容被列为“经典”编辑器内容单击“经典”以打开一个对话框,Then click "转换为块”

如何将古腾堡编辑器添加到 WooCommerce

保存产品描述现在您将能够编辑 Gutenberg 中的现有内容

关于将 Gutenberg编辑器添加到 WooCommerce 的常见问题解答

将代码添加到我的主题函数文件是否安全?

No,不建议将代码直接添加到您的主题文件中以集成 WooCommerce 和 Gutenberg这是因为如果您切换或更新主题代码可能会丢失这将带您回到经典的 WordPress 编辑器

是否有必要具备编码知识才能在 WooCommerce 中实现 Gutenberg 编辑器?

No,您无需具备编码知识即可为 WooCommerce 启用 Gutenberg您可以简单地使用 Code Snippets 插件将代码添加到您的主题文件中然后开始使用 Gutenberg for WooCommerce

古腾堡和经典编辑器有什么区别?

经典的 WordPress 编辑器是一个简单的文本编辑器如 Microsoft Word提供基本的格式选项而 Gutenberg 编辑器是一个拖放式编辑器提供用户友好的界面来编辑和设计您的网站

如何将 Gutenberg 编辑器与 WooCommerce 产品页面集成?

要将 Gutenberg 编辑器与 WooCommerce 产品页面集成您需要使用像 Code Snippets 这样的插件此插件将允许您向您的网站添加代码以启用 Gutenberg

我可以在 WooCommerce 中使用自定义 Gutenberg 块进行产品描述吗?

Yes,您可以在 WooCommerce 中使用自定义 Gutenberg 块进行产品描述Gutenberg 在产品页面和描述的设计和定制方面为您提供了充分的灵活性使您能够创建令人惊叹的电子商务网站

If needed,我可以在将 Gutenberg 添加到 WooCommerce 后恢复到经典编辑器吗?

Yes,您可以在需要时切换回 WooCommerce 中的经典编辑器

结束语

切换到您的 WooCommerce 网站的 Gutenberg 编辑器可以为您的网站打开无限的设计可能性和无缝的编辑体验

通过遵循本文中给出的两种方法您可以轻松地将 Gutenberg 添加到 WooCommerce 并使用各种独特的块和出色的设计元素增强您的在线商店

About Editorial Department

kuajinggu’s editorial staff is a team of WordPress experts,Led by Dylan,In WordPress、virtual host、e-commerce、Over 10 years of experience in SEO and marketing。kuajinggu was created in 2014 Year,Currently the largest free WordPress resource website in the industry,Often referred to as the Wikipedia of WordPress。