$args = array( 'post_type' => 'post', 'category' => 'voprosyi', 'posts_per_page' => 5);
$the_query = new WP_Query( $args );
while ( $the_query->have_posts() ) {
$the_query->the_post();
$qname = get_field("faq_name");
$qtext = get_field('faq_text');
$qdate = get_the_date('j F Y', $post->ID);
$aname = get_field('faq_answer_name');
$atext = get_field('faq_answer_text');
echo '<div>';
echo '<div class="faq-date">Спрашивает <time>'.$qdate.'</time></div>';
echo '<div class="author"><span>'.$qname.' </span>:</div>';
echo '<div itemprop="text"><p>'.$qtext.'</p></div>';
echo '<div class="answer""><div class="faq-date">Отвечает <time>'.$qdate.'</time></div>';
echo '<div class="answer-author"><span>'.$aname.':</span></div>';
echo '<div itemprop="text"><p>'.$atext.'</p></div></div></div>';
}
wp_reset_postdata();
?>
<nav>
<ul class="pagination">
<?php the_posts_pagination(); ?>
<?php
$args = array( 'post_type' => 'post', 'category' => 'voprosyi', 'posts_per_page' => 5);
$the_query = new WP_Query( $args );
while ( $the_query->have_posts() ) {
$the_query->the_post();
$qname = get_field("faq_name");
$qtext = get_field('faq_text');
$qdate = get_the_date('j F Y', $post->ID);
$aname = get_field('faq_answer_name');
$atext = get_field('faq_answer_text');
echo '<div>';
echo '<div class="faq-date">Спрашивает <time>'.$qdate.'</time></div>';
echo '<div class="author"><span>'.$qname.' </span>:</div>';
echo '<div itemprop="text"><p>'.$qtext.'</p></div>';
echo '<div class="answer""><div class="faq-date">Отвечает <time>'.$qdate.'</time></div>';
echo '<div class="answer-author"><span>'.$aname.':</span></div>';
echo '<div itemprop="text"><p>'.$atext.'</p></div></div></div>';
}
?>
<nav>
<ul class="pagination">
<?php the_posts_pagination(); ?>
</ul>
</nav>
<?php wp_reset_postdata(); ?> <!-- сброс цикла - в самом конце -->