Last active
August 29, 2015 14:22
-
-
Save generatepress/261aa39f5e594c243c02 to your computer and use it in GitHub Desktop.
Remove the page title from pages in GeneratePress
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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