There is a page template. It displays the posts from a custom post type. Trying to get pagination
<?php the_posts_pagination( array('show_all' => true 'prev_next' => false, 'add_args' => false, 'add_fragment' => ", ) ); ?>
Displays anything. Apparently due to the fact that $GLOBALS['wp_query']->max_num_pages viswasam 0. Posts 4 if
'posts_per_page' => '2', 'posts_per_archive_page' => '2',
Found the pattern - If the code to insert directly on the page, the pagination starts to work. If using add and the do_action function. Need some kind of global variable? Tell me what it is.