Created
August 23, 2012 02:19
-
-
Save thinkstylestudio/3431446 to your computer and use it in GitHub Desktop.
Disables all posts on a blog.
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
// From http://wordpress.stackexchange.com/questions/44983/disable-single-post-page | |
add_action( 'pre_get_posts', 'single_post_404' ); | |
function single_post_404( $query ) { | |
if ( $query->is_main_query() && $query->is_single() ) | |
$query->is_404 = true; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment