Reply To: Full Width Title On Single Post / Page

Home Forums Support Full Width Title On Single Post / Page Reply To: Full Width Title On Single Post / Page

Home Forums Support Full Width Title On Single Post / Page Reply To: Full Width Title On Single Post / Page

#109517
Tom
Lead Developer
Lead Developer

Ah, flaw in my code!

Try this function:

add_filter( 'the_title', 'generate_remove_page_titles', 10, 2 );
function generate_remove_page_titles( $title, $id = null )
{
	global $post, $generate_content_filter_completed;
	
	if ( $generate_content_filter_completed ) {
		return $title;
	}
	
	if ( ( is_page() || is_single() ) && in_the_loop() && $title == $post->post_title )
		return '';
		
	return $title;
}

add_filter( 'the_content', 'generate_content_filter_completed' );
function generate_content_filter_completed( $content ) 
{
	global $generate_content_filter_completed;
	$generate_content_filter_completed = true;
	return $content;
}

You will still need to use the function you linked to so it re-adds the title below the header. The function above basically makes it so you don’t have to have custom content-page.php and content-single.php files.