Avada theme has a Page Title Bar option which lets you display the Title of the Page along with the Breadcrumbs in it. This option can be enabled/disabled globally but its not possible to disable for a specific post type like WooCommerce products. I have provided a code snippet below that can be used to remove the Page Title Bar from WooCommerce products only while keeping it enabled for the rest of the website.
This needs to be done in Avada Child Theme to avoid the chance of losing on theme update. Avada Child Theme comes in the Avada Full Package. If you don’t find the Avada Child Theme in there, you can download it from here and install in your website.
Once done, you can need to go Dashboard -> Appearance -> Editor section and select functions.php file and put the below code in it and save changes.
add_action( 'template_redirect', 'avada_check_page' );
function avada_check_page() {
if ( is_singular( 'product' ) ) {
add_action( 'avada_override_current_page_title_bar', 'avada_remove_title_bar' );
}
}
function avada_remove_title_bar() {
}
Once the code is saved, the Page Title Bar of Avada theme won’t be appearing on the WooCommerce single product pages only.
The above code can be used for any custom post type but you need to replace the quoted text of ‘product’ in line # 3 to the name of your own Custom Post Type.
Beautiful! Works as advertised. Wish Avada had a tighter integration with WooCommerce to do simple things like this but for now this will work. Thanks for taking the time to share… you helped this guy out.
-Aaron
Glad to hear that :-)
Works good, Thanks.
but what if i want the titlebar height set to 200px instead of not showing??
-Dave
You can use the below CSS into your Theme Options -> Page Title Bar section to make it work for products only;
.single-product .fusion-page-title-bar {
height: 200px !important;
}
Nice work!
Is there any way to hide title bar only on Author’s page?
Could you try below code for author page?
add_action( 'template_redirect', 'avada_check_page' );
function avada_check_page() {
if ( is_author ) {
add_action( 'avada_override_current_page_title_bar', 'avada_remove_title_bar' );
}
}
function avada_remove_title_bar() {
}
Wonderful!!!
I just fixed it ‘is_author’ into ‘is_author().
Thanks.
Thank you Muhammad! That removed the title’s on the first go. Very helpful!