Hi @bloke
Thanks for reaching out!
Can you please share the URL or link to your site so that we could provide the correct snippet for you?
Thread Starter
Bloke
(@bloke)
It has a under construction page up so I can’t share it now. I am trying to do it with a function rather than hiding it with CSS.
Hello @bloke,
As Xue28 mentioned CSS is a better solution for this. Either way, you can use the following code snippet. 😃
add_filter( 'the_title', 'remove_page_title', 10, 2 );
function remove_page_title( $title, $id ) {
if( is_home() || is_front_page() )
return '';
return $title;
}
Source
I’ve tested it on my site and can confirm it works.
Hope it helps!
Thread Starter
Bloke
(@bloke)
That works but it removes the page links in my navigation.
I added CSS and had to add a class to the page title for it to work. Still not sure why the function was removing my navigation links.
-
This reply was modified 3 years, 7 months ago by
Bloke.
I added CSS and had to add a class to the page title for it to work. Still not sure why the function was removing my navigation links.
That’s why I recommended going with CSS, with functional code the function could remove the element from unexpected places.
That said, I’m glad to hear you’ve figured it out. 😃
I will go ahead and mark this as solved, if you have a few minutes, we’d love it if you could leave us a review: https://wordpress.org/support/plugin/woocommerce/reviews/
Cheers!