is_main_query() && ! is_admin() ) { $query->set( 'ignore_sticky_posts', true ); $query->set( 'post__not_in', get_option('sticky_posts') ); } } add_action( 'pre_get_posts', 'remove_sticky_from_main_loop' ); /** * AJAX load more, following this tutorial - https://rudrastyh.com/wordpress/load-more-posts-ajax.html */ function atlas_loadmore_ajax_handler(){ // prepare our arguments for the query $args = json_decode( stripslashes( $_POST['query'] ), true ); $args['paged'] = $_POST['page'] + 1; // we need next page to be loaded $args['post_status'] = 'publish'; // it is always better to use WP_Query but not here query_posts( $args ); if( have_posts() ) : // run the loop while( have_posts() ): the_post(); ?>

+