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

Hello Everyone I want to remove footer from woocommerce product page. I am not able to find out the pagename, so I can remove wp_footer code from there.

How can I achieve this?

please guide me.

You can use native conditionals combined together, is_cart(), is_checkout() and is_account_page(), in the footer.php file of your active theme or child theme, this way to hide some elements from footer (for WooCommerce shop page and products pages):

if ( !is_cart() || !is_checkout() || !is_account_page() ) { 

    // On WooCommerce shop and product pages

   // here goes CUSTOM displayed footer code for WooCommerce shop and product pages

} else { // your normal footer code

    // here goes all displayed footer code

} 

Depending on what you want to hide from woocommerce pages, you will have to adapt it in your existing code, to feet yours needs. But does not remove wp_footer to avoid big problems.

Reference: Official WooCommerce Conditional Tags


After that you can Override WooCommerce Templates via a Theme using my account templates to fine tune even more WooCommerce behaviors…

You can remove footer from WooCommerce product page -

 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
 }

use this code in footer.php file .

If you want to learn more, you can check this - WooCommerce conditional tags