In my wordpress I created a menu in the Backand called "Opinions". This I have put as a loop on my page, so that it shows the last 10 post.
<div class="container">
<?php
$categories = get_categories( array(
'child_of'=>'Opiniones'
) );
$subcategories = array();
foreach ( $categories as $category ) {
$subcategories[] = $category->cat_ID;
}
?>
<?php
$new_loop = new WP_Query( array(
'post_type' => 'Opiniones',
'category__in' => $subcategories,
'posts_per_page' => 10
) );
?>
<?php if ( $new_loop->have_posts() ) : while ( $new_loop->have_posts() ) : $new_loop->the_post(); ?>
<div>
<hr/>
<div class="info">
<div class="autor"><p><?php the_field('autor-title'); ?></p> <strong><p><?php the_field('autor'); ?></p></strong></div>
<div class="datum"><p><?php the_field('datum_title'); ?></p> <strong><p><?php the_field('datum'); ?></p></strong></div>
</div>
<h2><?php the_title(''); ?></h2>
<?php the_content(''); ?>
</div>
<?php endwhile; else: ?>
<?php endif; ?>
<?php wp_reset_query(); ?>
</div>
Now what I need is to create a Pagination below so that the visitor can go back and see the previous posts but only from the "Opinions" menu. I am quite new in this and there are still things that escape me. Thank you all