Question

I have been searching online for this and everywhere I go it says to put the following into your functions.php

function remove_title_from_home() {
   remove_action( 'storefront_homepage', 'storefront_homepage_header', 10 );
}
add_action( 'woocommerce_show_page_title', 'remove_title_from_home' );

OR

function remove_title_from_home() {
   if ( is_front_page() ) remove_action( 'storefront_page', 'storefront_page_header', 10 );
}
add_action( 'woocommerce_show_page_title', 'remove_title_from_home' );

Just in case there is an update to the theme which will overwrite this as I am not using a child theme, I put them into a plugin file I created a long time ago (custom-functions.php) and all other functions I have put in there work. I have cleared WP caches and browser caches, yet neither of the suggestions above are working for me. Even though the same is suggested at StackOverflow

The answer here at Removing title from page is not good for SEO and Woocommerce: How to remove page-title at the home/shop page but not category pages doesn't seem to help me as the suggestions are not working for me.

The homepage content is the only page I am displaying on the front (home) page

enter image description here

Has there been a change to the Storefront Theme since these answers were put together or is there something I am possibly doing wrong?

Was it helpful?

Solution

Try this:

add_action( 'wp', 'storefront_remove_title_from_home_homepage_template' );
 
function storefront_remove_title_from_home_homepage_template() {
   remove_action( 'storefront_homepage', 'storefront_homepage_header', 10 );
}

or if you use default template

add_action( 'wp', '_storefront_remove_title_from_home_default_template' );
 
function storefront_remove_title_from_home_default_template() {
   if ( is_front_page() ) remove_action( 'storefront_page', 'storefront_page_header', 10 );
}
Licensed under: CC-BY-SA with attribution
Not affiliated with wordpress.stackexchange
scroll top