Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
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
// 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