How to hide title output on all static pages?
Add the following snippet to file functions.php
of child theme or in plugin FunctionsPHP:
function themeslug_basic_before_page_title(){ ob_start(); } add_action( 'basic_before_page_title', 'themeslug_basic_before_page_title' ); function themeslug_basic_after_page_title(){ ob_clean(); } add_action( 'basic_after_page_title', 'themeslug_basic_after_page_title' );
How to hide title output for certain static pages?
Add the following snippet to file functions.php
of child theme or plugin FunctionsPHP. Edit conditions in lines 15 and 20, specifying appropriate ID, slugs (shortcuts) or page titles on which you don’t want to display title.
function themeslug_basic_before_page_title(){ ob_start(); } add_action( 'basic_before_page_title', 'themeslug_basic_before_page_title' ); function themeslug_basic_after_page_title(){ $title = ob_get_clean(); // set up conditions below where you want disable title // disable title on page with slug 'contacts' if ( is_page( 'contacts' ) ){ return; } // disable title on pages with slug 'contacts', title 'Out Contacts' or ID 42 if ( is_page( array('Page Comments','Out Contacts',1146) ) ){ return; } // else show page title by default echo $title; } add_action( 'basic_after_page_title', 'themeslug_basic_after_page_title' );