<?php
$published_posts = wp_count_posts()->publish;
$posts_per_page = -1;
$paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
$args=array(
    'post_type' => 'lp_course',
    'post_status' => 'publish',
    'paged'=>$paged,
    'posts_per_page'=>$posts_per_page
);
$igor_courses = null;
$igor_courses = new WP_Query($args);
    if( $igor_courses->have_posts() ) {
    $position = 0;
    while( $igor_courses->have_posts() ){ $igor_courses->the_post();
        if ( $position % 4==0 ) { ?>
        <div class="row">
        <?php } ?>
            <div class="col-lg-3 col-md-3 col-sm-3 col-xs-12 course-item">
            <?php get_template_part( 'template-parts/content', 'courses' ); ?>
            </div>
        <?php $position++;
        if ($position != 0 and $position % 4==0) { ?>
        </div>
        <?php } ?>
    <?php } ?>
    <?php  wp_reset_postdata();
    } else {
        get_template_part( 'template-parts/content', 'none' );
} ?>
