while ( have_posts() ) : the_post();
<?
$args = array(
'post_type' => 'post'
);
$query = new WP_Query;
$posts = $query->query($args);
//print_r($posts);
?>
<?foreach($posts as $post):
$postUrl = get_the_permalink();
$postTitle = esc_html($post->post_title); /* esc_html(get_the_title()) */
$postDesc = wp_trim_words(esc_html($post->post_content), 10);
$postDate = get_the_date('n.j.Y');
$idImage = get_post_thumbnail_id($post->ID);
$postImageUrl = wp_get_attachment_image_src($idImage, 'full');
$thumb_img = get_post_meta($idImage);
$postImgAlt = $thumb_img['_wp_attachment_image_alt'][0];
$postCat = get_the_category();
//print_r($postCat);
?>
<article class="article-list" role="article">
<div class="row">
<div class="col-xl-6 col-lg-6">
<div class="article-list-img flex turquoise">
<a href="<?=$postUrl;?>" title="<?=$postTitle;?>">
<img src="<?=$postImageUrl[0];?>" alt="<?if($postImgAlt != ''){echo $postImgAlt;}?>">
</a>
</div>
</div>
<div class="article-list-right col-xl-6 col-lg-6">
<div class="article-list-cat">
<?foreach($postCat as $cat):?>
<a class="article-list-cat-link" href="<?=get_category_link($cat->term_id);?>" title="<?=$cat->category_description;?>"><?=$cat->cat_name;?></a>
<?endforeach;?>
</div>
<div class="article-list-title">
<a class="article-list-title-link" href="<?=$postUrl;?>" title="<?=$postTitle;?>"><?=$postTitle;?></a>
</div>
<div class="article-list-desc"><?=$postDesc;?></div>
<div class="article-list-info">
<i class="fa fa-calendar" aria-hidden="true"></i> <a href="#date" title="Пост опубликован <?=$postDate;?>"><?=$postDate;?></a>
<i class="fa fa-comments" aria-hidden="true"></i> <a href="<?=$postUrl;?>#comments" title="<?comments_number('Комментировать', '1 комментарий', '% комментариев');?>"><?comments_number('Комментировать', '1 комменатрий', '% комментариев');?></a>
<i class="fa fa-eye" aria-hidden="true"></i> <a href="#view" title="">234</a>
</div>
</div>
</div>
</article>
<?endforeach;?>