Last active
December 17, 2015 01:49
-
-
Save braddalton/5530851 to your computer and use it in GitHub Desktop.
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_action( 'pre_get_posts', 'remove_posts_in_category_on_blog' ); | |
/** | |
* @author Brad Dalton - WP Sites | |
* @example http://wpsites.net/web-design/exclude-category-posts-page/ | |
*/ | |
function remove_posts_in_category_on_blog( $query ) { | |
global $wp_the_query; | |
if( $wp_the_query === $query && $query->is_home() ) { | |
$query->set( 'cat', '-007' ); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment