Skip to content

Instantly share code, notes, and snippets.

@braddalton
Last active December 14, 2015 03:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save braddalton/5021623 to your computer and use it in GitHub Desktop.
Save braddalton/5021623 to your computer and use it in GitHub Desktop.
Add code to themes hooks plugin or index.php to remove posts from one or more categories from displaying on the home page
//Code for one category
<?php if ( is_home() ) { query_posts( 'cat=-1' ); } ?>
//Code for multiple categories
<?php if ( is_home() ) { query_posts( 'cat=-1,-2,-3' ); } ?>
/**
* @author Brad Dalton - WP Sites
* @example http://wp.me/p1lTu0-9OJ
*/
// Change conditional tag to remove posts from displaying on blog or other pages
// Change category i.d's to your own
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment