0 ) : $total_posts_number = wp_count_posts()->publish; $ad_spot_gap = $total_posts_number / $archive_ads_number; $ads_rendered = 0; $paged = get_query_var( 'paged' ); endif; echo '
'; //inner-content-wrap // $post_counter = 0; while ( have_posts() ) : the_post(); if( $archive_ads_number > 0 ) : if( ! isset( $ad_spot ) ) $ad_spot = rand( $ads_rendered * $ad_spot_gap, $ad_spot_gap * ( $ads_rendered + 1 ) ); if( $ad_spot == $wp_query->current_post ) { if( $ads_rendered >= $ads_rendered + $paged ) $ads_rendered = $ads_rendered + $paged; blogcast_random_post_archive_advertisement_part( $ads_rendered ); unset($ad_spot); $ads_rendered++; } endif; /* * Include the Post-Type-specific template for the content. * If you want to override this in a child theme, then include a file * called content-___.php (where ___ is the Post Type name) and that will be used instead. */ get_template_part( 'template-parts/archive/content', blogcast_get_post_format() ); // $post_counter++; endwhile; echo '
'; // end: blogcast-inner-content-wrap /** * hook - blogcast_pagination_link_hook * * @package Blogcast * @since 1.0.0 */ do_action( 'blogcast_pagination_link_hook' ); else : get_template_part( 'template-parts/content', 'none' ); endif; ?>