Created
September 17, 2014 13:49
-
-
Save krohn/0059487bad67c75e8f3d to your computer and use it in GitHub Desktop.
No "Quick Tips" on the homepage
This file contains hidden or 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
// No "Quick Tips" on the homepage | |
// http://www.wprecipes.com/how-to-prevent-posts-from-a-particular-category-to-be-displayed-in-wordpress-loop | |
function preventHomepageTips($query) { | |
if($query->is_home() && $query->is_main_query()) { | |
$query->set('cat', '-40'); // 40 is Quick Tips's category ID | |
} | |
} | |
add_action('pre_get_posts', 'preventHomepageTips'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment