<?php get_header(); ?>
    <div class="row clearfix">
        <div class="col-12 col-md-8 col-xl-9">
            <div class="row clearfix d-block">
                <?php if ( have_posts() ) : ?>
                        <?php
                                $rand = rand(4,5);
                                while ( have_posts() ) : $postNum++;
                                    ad_inlist_mobile($postNum);
                                    the_post();
                                    if ($postNum == $rand && $already == false ):
                                        $already = true;
                                        get_template_part( 'content', 'preview-long-rubrick' );
                                    else:
                                        get_template_part( 'content', 'preview-short-rubrick' );
                                    endif;
                                endwhile;
                                if(is_category()):
                                        $cat = get_query_var('cat');
                                        $category = get_category ($cat);
                                        echo do_shortcode('[ajax_load_more cache="true" cache_id="'.wp_is_mobile().crc32('archive-articles-category').get_queried_object_id().get_last_id().'" id="category_request" scroll_distance="50" button_label="Загрузить еще" container_type="div" post_type="profile_article,anew" offset="'.get_option('posts_per_page').'" posts_per_page="10" category="'.$category->slug.'"]');
                                endif;
                                if(is_author()):
                                    echo do_shortcode('[ajax_load_more cache="true" cache_id="'.wp_is_mobile().crc32('archive-articles-author').get_queried_object_id().get_last_id().'" id="author_request" scroll_distance="50" button_label="Загрузить еще" container_type="div" post_type="profile_article" offset="'.get_option('posts_per_page').'" posts_per_page="10" author="'.get_the_author_ID().'" ]');
                                endif;
                        ?>
                <?php
                        else :
                                get_template_part( 'content', 'none' );
                        endif;
                ?>
            </div>
        </div>
        <div class="col-12 col-md-4 col-xl-3">
            <div class="right-side">
                    <?php dynamic_sidebar('right_sidebar'); ?></div>
                    <div class="js-stickybit">
                        <?php get_template_part( 'content', 'ad' ); ?>
                    </div>
            </div>
        </div>
    </div>
<?php get_footer(); ?>