• next_posts_link () started displaying pagination after 11 blog posts. But I changed the home page and chose one category. the next_posts_link () function still thinks that I have 11 posts on the page, although there are 2 from the same category. Sorry for my English, I use a translator.

    <?php
    $blog_args = array(
                                    'post_type' => 'post',
                                    'cat' => 48, //chose one category
                                    'posts_per_page' => 10,
                                    'order' => 'DATE',
                                    'orderby' => 'DESC',
                                    'tax_query' => $tax_query,
                                    'paged' => $paged
                                    );
    $blog_query = new WP_Query($blog_args);
    ?>
    • This topic was modified 3 years, 10 months ago by galtsevt.
Viewing 1 replies (of 1 total)
  • The functions that compute pagination links use the main query for the page. Your query is separate from the main query.

Viewing 1 replies (of 1 total)
  • The topic ‘next_posts_link() does not work correctly’ is closed to new replies.