<section class="newsfeed">
<div class="container">
<div class="row">
<?php
$count_posts = wp_count_posts();
$count_posts_1 = $count_posts - 1;
$args = array(
'post_type' => 'post',
'posts_per_page' => $count_posts_1
);
$query = new WP_Query( $args );
while ( $query->have_posts() ) {
$query->the_post();
echo '<div class="col-md-4 col-sm-6 item box-hidden">
<div class="post-img">' .
'<a href="' . get_the_permalink() . '">' . get_the_post_thumbnail() . '</a>' .
'<div class="cat-name">' .
get_the_category_list(',') .
'</div>
</div>
<div class="post-description">
<h3>
<a href="' . get_the_permalink() . '">' .
get_the_title() .
'</a>
</h3>
<div class="post-meta">
<span class="date">' . get_the_date('j F') . '</span>
<span class="comment-number">
<i class="fa fa-comment-o" aria-hidden="true"></i> ' . get_comments_number() .
'</span>
</div>
</div>
</div>';
}
wp_reset_postdata();
?>
</div>
<button id="loadMore" class="primary-button">Показать еще</button>
</div>
</section>
...
echo '<div class="col-md-4 col-sm-6 item box-hidden">
<a href="' . get_the_permalink() . '">
<div class="post-img">' . get_the_post_thumbnail() . '
<div class="cat-name">' . get_the_category_list(',') . '</div>
</div>
<div class="post-description">
<h3>' . get_the_title() . '</h3>
<div class="post-meta">
<span class="date">' . get_the_date('j F') . '</span>
<span class="comment-number"><i class="fa fa-comment-o" aria-hidden="true"></i> ' . get_comments_number() . '</span>
</div>
</div>
</a>
</div>';
...
<section class="newsfeed">
<div class="container">
<div class="row">
<?php
$count_posts = wp_count_posts();
$count_posts_1 = $count_posts - 1;
$args = array(
'post_type' => 'post',
'posts_per_page' => $count_posts_1
);
$query = new WP_Query( $args );
while ( $query->have_posts() ) {
$query->the_post();
echo '<a href="' . get_the_permalink() . '" class="col-md-4 col-sm-6 item box-hidden">
<div class="post-img">' .
get_the_post_thumbnail() .
'<div class="cat-name">' .
get_the_category_list(',') .
'</div>
</div>
<div class="post-description">
<h3>' . get_the_title() . '</h3>
<div class="post-meta">
<span class="date">' . get_the_date('j F') . '</span>
<span class="comment-number">
<i class="fa fa-comment-o" aria-hidden="true"></i> ' . get_comments_number() .
'</span>
</div>
</div>
</a>';
}
wp_reset_postdata();
?>
</div>
<button id="loadMore" class="primary-button">Показать еще</button>
</div>
</section>