I am trying to hide the Storefront page title on my homepage. This code hides it from all the side:
But I can't use is_front_page() because WordPress loads functions.php before the $wp_query object has been set up with the current page, as explained <a href="https://wordpress.stackexchange.com...theme-file-and-does-not-work-in-functions-php">here</a>.
I would prefer not using the plugin "Title Toggle for Storefront Theme".
Thank you.
Code:
function sf_change_homepage_title( $args ) {
remove_action( 'storefront_page', 'storefront_page_header', 10 );
}
add_action( 'init', 'sf_change_homepage_title' );
But I can't use is_front_page() because WordPress loads functions.php before the $wp_query object has been set up with the current page, as explained <a href="https://wordpress.stackexchange.com...theme-file-and-does-not-work-in-functions-php">here</a>.
I would prefer not using the plugin "Title Toggle for Storefront Theme".
Thank you.