我已经完成了这些事情并且我已经仔细检查了所有事情
在插件/woocommerce/templates/archive-product.php
我刚刚复制到 my-themes/woocommerce/archive-product.php 以覆盖核心 woocommerce 文件。
但在我尝试了很多次之前,它不仅与 underscores.me 一起工作,但它正在工作,但在最新的更新中它不起作用
厕所版本:3.3.5
服务器信息:Apache/2.4.18 (Ubuntu)
PHP版本:5.6.33-3+ubuntu16.04.1+deb.sury.org+1
my_theme/woocommerce/archive-product.php,
my_theme/woocommerce/content-product.php,
my_theme/woocommerce/content-product_cat.php,
my_theme/woocommerce/content-single-product.php,
my_theme/woocommerce/myaccount/form-login.php,
my_theme/woocommerce/single-product/add-to-cart/variable.php,
my_theme/woocommerce/single-product/meta.php,
my_theme/woocommerce/single-product/short-description.php,
my_theme/woocommerce/single-product.php,
my_theme/woocommerce/taxonomy-product_cat.php
最佳答案
我只是在一些研究后找到了解决方案,我们只需将以下函数添加到我们的主题 functions.php 文件中
add_theme_support( 'woocommerce' );
请阅读此页面,您也将准确了解主题支持和其他内容
https://pmgarman.me/add-woocommerce-support-to-underscores/
它对我有用 underscores.me 主题
关于php - Woocommerce archive-product.php 覆盖不适用于 underscores.me 主题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49790717/