Not working pagination wordpress?

Hi all. I have this problem in wordpress. pagination throws 404 error in a custom category. Scoured the Internet, nothing does not help, can not understand what the problem is. Pagination appears and divides into the page but click on any of the pages are 404.

Here is the entire code in function.php

$args = array(
 'labels' => $labels,
 'public' => true,
 'publicly_queryable' => true,
 'show_ui' => true,
 'show_in_menu' => true,
 'query_var' => true,
 'capability_type' => 'post',
 'has_archive' => false,
 'hierarchical' => false,

 'supports' => array( 'title', 'editor', 'custom-fields', 'comments' )
);

register_post_type( 'plan', $args );

register_taxonomy(
'vuz',
'plan',
array(
 'label' => 'UNIVERSITY',
 'hierarchical' => true,
)
);

register_taxonomy(
'spec',
'plan',
array(
 'label' => 'Specialty',
 'hierarchical' => false,
)
);


Here is the output in the page template:

<section id="posts">

 <div class="breadcrumbs">
 <?php if (function_exists('bcn_display')) {
bcn_display();
 } ?>
</div>



 <div class="catalog">
 <h2 class="line">All curricula</h2> 
<?php
 $args = array(
 'post_type' => 'plan',
 'publish' => true, 
 'paged' => get_query_var('paged'),
'post_status'=>'publish',
 'posts_per_page' => '10',
 'posts_per_archive_page' => '10', 
);
 query_posts($args); ?> 
 <?php if (have_posts()): ?>
 <div class="newJobs">
 <?php while (have_posts()): the_post(); ?>
 <?php get_template_part('content', 'plan'); ?> 
 <?php endwhile; ?> 
 </div><!-- newJobs END--> 
 <?php endif; ?> 

 <?php echo get_the_posts_pagination(); ?>
 <?php the_posts_pagination(); ?>

 <?php wp_reset_query(); ?> 

 <?php the_content(); ?>
 </div> 

 </section>


Do anything, 404 and that's it.

The URL turns like this: https://rektorat.ru/plan/page/2/
April 3rd 20 at 18:47
0 answer

Find more questions by tags WordPress