There was a problem with the navigation on the site. She simply does not have. And I tried to connect my own, and with the help of plug-ins and without, in any. Any changes in the right place are displayed, but the navigation is not. The site did not me. Thank.

Update

<?php get_header(); ?> <!-- #blocks-wrapper--> <div id="blocks-wrapper" class="clearfix"> <?php if (have_posts()) : while (have_posts()) : the_post(); ?> <!-- /blocks Left--> <div id="blocks-left" <?php post_class('eleven columns');?>> <!-- .post-content--> <div class="post-content"> <!--/.post-outer --> <div class="post-outer clearfix"> <!--.post-title--> <div class="post-title"><h1 class="entry-title"><?php the_title(); ?></h1></div> <!--/.post-title--> <!-- .post_content --> <div class = 'post_content entry-content'> <div> </div> <?php the_content(); ?> <div class="clear"></div> </div> <!-- /.post_content --> <?php wp_link_pages(); ?> <div class='clear'></div> </div> <!--/.post-outer --> </div> <!-- post-content--> <?php comments_template(); ?> <?php endwhile; ?> <?php endif; ?> </div> <!-- /blocks Left -or -right --> <?php get_sidebar(); ?> <?php get_footer(); ?> 

The code of the page on which you need navigation, and tried to implement it as a plug-in with all sorts and without them. After installing the plugin, it tells me to call the navigation function on the desired page, but no changes.
Update

 var_damp($wp_query->max_num_pages); 

result

 int(0) 

What is the problem?

  • Are you talking about pagination? - Roma Slobodian
  • Yes, about pagination. - O.Vykhor
  • Describe in more detail how you tried to connect, give an example of the code of the page on which navigation does not work - alenkins

1 answer 1

You use the wp_link_pages() function, which is needed for multi-page posts (if the post needs to be divided into several pages), and not for navigating through the site. If you need the classic "pagination", use the wp_list_pages() function ( documentation ). Note also that, unlike wp_link_pages() , it is used outside the while(have_posts())

  • wp_link_pages () was still called in that place before me, but it doesn’t give anything, I have some number of records, and I need to do page-by-page navigation with a certain number of records per page. - O.Vykhor
  • I repeat: you do not need wp_link_pages() . You need to use the wp_list_pages() function. Read my answer carefully, the names of the functions are similar, but the work is fundamentally different. In addition, check that the site settings (your_site_name.com/wp-admin/options-reading.php) set the correct limit on the number of posts per page (the item " Show no more than pages on the blog pages") - alenkins
  • And I'm not saying that I need wp_link_pages () and all these settings are in my admin panel, the wp_list_pages () function displays just a list of all pages and not navigation. - O.Vykhor
  • At the same time displays a list of pages with other content. - O.Vykhor