Last active
December 14, 2015 03:29
-
-
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
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
//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