我开发了一个非常基本的WordPress主题并安装了WooCommerce。WooCommerce的每个功能都在我的主题中完美地工作。
问题:仅在产品详细页面、产品评论选项卡、评论列表和评审表单中缺少。
在WooCommerce设置下,设置是启用的,在WordPress中,讨论设置也是启用的。
对于产品详细页面,我使用“单产品·For”模板,并使用以下代码。
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
<h2><?php the_title();?></h2>
<?php the_content();?>
<?php endwhile; endif; ?>注意:当我在functions.php中添加以下内容时,整个商店和WooCommerce都停止工作,一切都被扭曲了。
add_theme_support( 'woocommerce' );请建议如何解决这个问题。
发布于 2020-07-08 18:45:41
如果您已经完美地完成了代码,但请不要忘记产品管理端的启用评审选项。
这里,我已经解释了步骤,供您参考。在管理端产品数据中,->高级->启用审查

发布于 2019-01-08 07:53:37
您需要添加此函数并检查是否启用了注释?遵循这个链接https://github.com/woocommerce/woocommerce/wiki/Declaring-WooCommerce-support-in-themes
function mytheme_add_woocommerce_support() {
add_theme_support( 'woocommerce' );
}
add_action( 'after_setup_theme', 'mytheme_add_woocommerce_support' );https://stackoverflow.com/questions/54087209
复制相似问题