Created
April 13, 2013 06:44
-
-
Save spencejs/5377353 to your computer and use it in GitHub Desktop.
Ignore Sticky Posts In Main Loop
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
//Ingore Sticky Posts | |
// this is key! | |
add_action('pre_get_posts', 'wpse74620_ignore_sticky'); | |
// the function that does the work | |
function wpse74620_ignore_sticky($query) | |
{ | |
// sure we're were we want to be. | |
if (is_home() && $query->is_main_query()) | |
$query->set('ignore_sticky_posts', true); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment