Created
May 31, 2013 05:06
-
-
Save braddalton/5683034 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 | |
* @link 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', '-18' ); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment