max_num_pages > 1 ) { ?>

have_posts()): ob_start(); while($posts->have_posts()):$posts->the_post(); get_template_part('template-parts/archive/archive-content'); endwhile;wp_reset_postdata(); $output['content'][] = ob_get_clean(); wp_send_json_success($output); else: $error = new WP_Error( '500', __('No More Posts','bloglex') ); wp_send_json_error( $error ); endif; wp_die(); } endif; add_action( 'wp_ajax_bloglex_load_posts', 'bloglex_load_posts' ); add_action( 'wp_ajax_nopriv_bloglex_load_posts', 'bloglex_load_posts' );