Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/282.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php WooCommerce-从产品页中删除页脚_Php_Wordpress_Woocommerce_Conditional - Fatal编程技术网

Php WooCommerce-从产品页中删除页脚

Php WooCommerce-从产品页中删除页脚,php,wordpress,woocommerce,conditional,Php,Wordpress,Woocommerce,Conditional,大家好,我想从woocommerce产品页面删除页脚。我无法找到页面名,因此我可以从那里删除wp\u页脚代码 我怎样才能做到这一点 请告诉我。您可以在活动主题或子主题的

大家好,我想从woocommerce产品页面删除页脚。我无法找到页面名,因此我可以从那里删除
wp\u页脚
代码

我怎样才能做到这一点


请告诉我。

您可以在活动主题或子主题的
文件中,将本机条件组合使用,
是购物车()
是结帐()
是账户页面()
,这样可以从页脚隐藏一些元素(对于WooCommerce商店页面和产品页面):

根据您想在woocommerce页面中隐藏的内容,您必须在现有代码中对其进行调整,以满足您的需要。但不删除wp_footer,以避免出现大问题

参考:



之后,您可以使用我的帐户模板微调更多的WooCommerce行为…

您可以从WooCommerce产品页面中删除页脚-

 if (is_product()) {   
   // here is your footer code which you want to display on woocommerce product page
 }
 else {
    // past your all footer code here for other pages
 }
footer.php文件中使用此代码

如果您想了解更多信息,可以检查以下内容-


不建议从任何页面中删除页脚,因为它可能会加载许多脚本和样式。您可以做的是向footer.php添加条件逻辑,如
if(!is_product()){load the footer html}
 if (is_product()) {   
   // here is your footer code which you want to display on woocommerce product page
 }
 else {
    // past your all footer code here for other pages
 }