File: /www/wwwroot/www.213n.cn/wp-content/themes/rk-blogger/index.php
<?php
/**
* The main template file
* Author: 闪电博
* Author URI: https://www.wbolt.com/
* Requires PHP: 7.0.0
*/
get_header();
?>
<div class="container container-index pw">
<div class="main main-list">
<?php if (have_posts()) : ?>
<div class="articles-list<?php echo get_list_mode_class(); ?>" id="J_postList">
<?php
$post_index = 0;
$ad_index = has_list_class() ? rand(3, 8) : -1;
while (have_posts()) : the_post();
get_template_part('template-parts/content', get_post_format());
if ($post_index == $ad_index) {
get_template_part('template-parts/content', 'list-ad');
}
$post_index++;
endwhile;
else :
get_template_part('template-parts/content', 'none');
endif;
?>
</div>
<div class="loading-bar"></div>
<?php
wbolt_the_posts_pagination();
?>
</div>
<?php get_sidebar(); ?>
</div>
<?php get_footer(); ?>