Hey guys,
Had a similar encounter and needed to remove the Page Title displayed by WooCommerce on a main template I was editing.
Rather than removing the lines from the original woocommerce-template.php file (as these changes would be overwritten if upgraded), you can simply add a filter to your theme’s functions.php file as follows:
//If You Want Page Title Displayed
add_filter(‘woocommerce_show_page_title’,true);
//If You Want Page Title Hidden
add_filter(‘woocommerce_show_page_title’,false);
Hope this helps someone 🙂
@ digicution
This worked perfectly, thank you!
@ crownprinceofdisco
No worries, glad it helped you out. Following on from this:
The filter didn’t work on the WooCommerce Cart & Checkout pages. These use the standard page template within your theme so in order to remove the title from these, you can use the is_cart() & is_checkout() functions to detect if we’re on those pages.
In my theme, I wanted to remove the title from the cart & checkout pages so in my page.php file, I replaced <?php the_title(): ?> with :
<?php
//If This Is Not WooCommerce Cart or Checkout
if(!is_cart() && !is_checkout()) {
//Write Out The Title
the_title();
//End If This Is Not WooCommerce Cart or Checkout
}
?>
Hope this helps 🙂