'post', 'paged' => $paged, ); if ( is_search() ) { $args['s'] = $term; } $blog_categories = apply_filters( 'awa_blog_cat_style', $blog_categories ); if ( ! empty($blog_categories ) ) { $cats = array(); foreach ( $blog_categories as $term_slug ) { $term_info = get_term_by( 'slug', $term_slug, 'category' ); $cats[] = $term_info->term_id; } if ( !is_search() ) { $args['category__in'] = $cats; } } $posts = new WP_Query( $args ); wp_localize_script( 'jquery', 'load_more_blog_posts', array( 'ajaxurl' => admin_url( 'admin-ajax.php' ), 'startPage' => $args['paged'], 'maxPage' => $posts->max_num_pages, 'nextLink' => next_posts( 0, false ) ) ); $count = isset($posts->post_count) && !empty($posts->post_count) ? $posts->post_count : '0'; $count_text = $count == '1' ? esc_html__('result found', 'awa') : esc_html__('results found', 'awa'); get_header(); ?> have_posts() ) : ?>