in Wordpress Themes by magicalwonders (1.9k points)

I'm trying to remove page titles on WooCommerce pages, but I'm not having much success.

I've created a child theme containing a folder called woocommerce, and inside this have put a copy of the file, archive-product.php

However, edits to this file have no effect on the page titles on my WooCommerce pages. Even if I edit the file directly in the WooCommerce plugin, it still has no effect!

I've found this code snippet which works if added to functions.php of TemplateToaster theme -

//If You Want Page Title Hidden
add_filter('woocommerce_show_page_title',false);
     /*

I'd prefer a solution that works with a child theme though. If I have to edit the main theme, that defeats the object of using a child theme! I've tried putting a copy of the edited functions.php file in my child theme, but it breaks the site! :(

Can anyone tell me what I'm missing, and save my sanity?

2 Answers

by magicalwonders (1.9k points)
I think I've found a solution!

Instead of copying functions.php file, Create a new one for the child theme that only contains the code snippet! Now the site won't break and the page titles on WooCommerce pages will be gone! :)
by sourcebreak (140 points)
wp-content/plugins/woocommerce/templates/archive-product.php

Edit this file archive-product.php and remove the below 3 lines.

 

 <?php if ( apply_filters( 'woocommerce_show_page_title', true ) ) : ?>

                        <h1 class="page-title"><?php woocommerce_page_title(); ?></h1>

                <?php endif; ?>

This will remove page title on shop page and all other pages.
Interested in localizing/Translating TemplateToaster Software in your native language in exchange of a Pro License ? Contact Us
...