'; $pagination_type = get_theme_mod( 'neve_pagination_type', 'number' ); if ( $pagination_type !== 'infinite' ) { global $wp_query; $posts_on_current_page = $wp_query->post_count; $hook_after_post = -1; if ( $posts_on_current_page >= 2 ) { $hook_after_post = (int) ceil( $posts_on_current_page / 2 ); } $post_index = 1; } neve_do_loop_hook( 'before' ); /** * Exclude posts from the main loop * * @param array $excluded_posts Excluded post ids. * @since 3.2 */ $excluded_posts = apply_filters( 'nv_exclude_posts', [] ); while ( have_posts() ) { the_post(); $pid = get_the_ID(); if ( in_array( $pid, $excluded_posts, true ) ) { continue; } neve_do_loop_hook( 'entry_before' ); if ( $load_before_after_hooks ) { /** * Executes actions before rendering the post content. * * @since 2.11 */ do_action( 'neve_loop_entry_before' ); } get_template_part( 'template-parts/content', get_post_type() ); if ( $load_before_after_hooks ) { /** * Executes actions after rendering the post content. * * @since 2.11 */ do_action( 'neve_loop_entry_after' ); } if ( $pagination_type !== 'infinite' && $load_before_after_hooks ) { if ( $post_index === $hook_after_post && $hook_after_post !== - 1 ) { /** * Executes actions in the middle of the loop. * * The actions only fires if the pagination is not set as "infinite scroll". * * @since 2.3.10 */ do_action( 'neve_middle_posts_loop' ); } $post_index ++; } neve_do_loop_hook( 'entry_after' ); } echo '
'; if ( ! is_singular() ) { /** * Executes the rendering function for the pagination. * * @param string $context Pagination location context. */ do_action( 'neve_do_pagination', 'blog-archive' ); } } else { get_template_part( 'template-parts/content', 'none' ); } ?>