Created
August 4, 2015 16:51
-
-
Save generatepress/711900a4c068cea1af6b to your computer and use it in GitHub Desktop.
Remove blog post titles from blog page (experimental)
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_blog_titles', 10, 2 ); | |
function generate_remove_blog_titles( $title, $id = null ) | |
{ | |
global $post, $generate_content_filter_completed; | |
if ( $generate_content_filter_completed ) { | |
return $title; | |
} | |
if ( is_home() || is_archive() ) { | |
$blog = true; | |
} else { | |
$blog = false; | |
} | |
if ( true == $blog && 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