SiteGround 注册无法接收短信验证码? 查看问题的解决方法
昨天上传新产品到 WooCommerce 网站的时候,发现添加产品描述的部分出现了一堆预设好的数据。其中的英文内容是:”Basic details – This info will be displayed on the product page, category pages, social media, and search results.“
保存草稿之后刷新页面会提示”The content of your post doesn’t match the template assigned to your post type.“ 选择 Keep it as is, 则产品描述文本框彻底消失。选择 Reset the template, 则回到了上图所示页面。
谷歌了一下,在 WordPress 官方论坛找到一篇帖子,和我遇到的问题类似 – https://wordpress.org/support/topic/site-doesnt-include-support-for-the-woocommerce-product-tab-block/
问题产品的原因可能是 WooCommerce 系统版本最近升级,在产品描述文本框中添加了一些产品模块”Product block“的功能,这一个新功能和通过修改代码或者安装插件使产品描述编辑器支持古腾堡编辑器 Gutenberg 的功能产品冲突,导致这个问题发生。
我禁用掉产品页面古腾堡编辑器 Gutenberg 功能之后,产品描述编辑框可以正常使用了。不过,和古腾堡编辑器比起来,传统编辑器在可视化操作,页面排版布局方面局限性太大了。
我尝试使用上面链接中 Cameron 提供的代码解决问题,但是没有成功。
function reset_product_template( $post_type_args ) {
if ( array_key_exists( 'template', $post_type_args ) ) {
unset( $post_type_args['template'] );
}
return $post_type_args;
}
add_filter( 'woocommerce_register_post_type_product', 'reset_product_template' );
随后联系了我在使用的 Shoptimizer 的主题作者 Simon,来回 5 封邮件,就解决了。
Simon 说会在接下来的主题更新中修复掉这个Bug。如果你也在使用 Shoptimizer 这个主题,可以直接联系 Simon 让他帮你修改主题代码;或者等他们的主题更新的发布。
Hi Conway,
I’ve spent some more time looking into this.
WooCommerce released an update earlier today – 7.7.0:
https://github.com/woocommerce/woocommerce/blob/trunk/changelog.txt
Which seems to have added those new elements to the block editor on a product page.
When reverting to the previous version of WooCommerce (7.6.1) – those new elements are gone – but that warning message you mentioned previously does appear.
I’ve updated your site with a beta of the next theme release, which has hopefully solved all of these goings on.
I’ve re-enabled the block editor on product pages and everything seems ok now.
Would you mind taking a look yourself and let me know if this is resolved now.
Kind regards,
Simon
最后安利一波 Shoptimizer 这个 WooCommerce 主题。不仅仅主题功能强大,网站速度,转化率等等各个方面的优化也做的非常到位;主题有特别详细的设置教程,也有非常棒的客服支持。价格也可以接受,目前在促销,原价99美金,现在半价 49美金。
暂无评论内容