/**
* Remove sticky posts from main loop
* @author Bill Erickson
* @link https://www.billerickson.net/code/remove-sticky-posts-main-loop/
*
* @param object $query
*/
function ea_remove_sticky_from_main_loop( $query ) {
if( $query->is_main_query() && ! is_admin() ) {
$query->set( 'ignore_sticky_posts', true );
}
}
add_action( 'pre_get_posts', 'ea_remove_sticky_from_main_loop' );