Wordpress website. There is a code:
<?php query_posts("cat=18"); while (have_posts()) : the_post(); get_template_part( "books-cat"); endwhile; ?> <?php if(function_exists('wp_pagenavi')) { wp_pagenavi(); } ?> The page displays posts and pagination. This pagination does not work, namely when you go to the second page, the address changes, and the posts are the same, i.e. from the first page.
How to make pagination work?