Skip to content

Instantly share code, notes, and snippets.

@generatepress
Last active August 29, 2015 14:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save generatepress/261aa39f5e594c243c02 to your computer and use it in GitHub Desktop.
Save generatepress/261aa39f5e594c243c02 to your computer and use it in GitHub Desktop.
Remove the page title from pages in GeneratePress
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() && 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;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment