$wp_query->found_posts returns incorrect number of posts (2 posts)

  1. einorris
    Posted 6 years ago #

    hello there,

    I have a blog with 244 post in it within the only category (id=1)

    i am trying to set up a pagination plugin (wp-page-numbers) and met following issue
    with 24 posts per page I got only 9 pages in my navi 1 2 ... 9
    but I should have 244/24 = 10.1 - at least 11 pages

    after some investigations I found out that ->found_posts returs only 216 - thus 28 posts were invisible for found_posts property..

    after that a went through my posts and got following distribution:
    March = 120 posts
    Feb = 96 posts
    Jan = 28 posts

    so it looks like by default found_posts "sees" only posts from Mar and Feb, but cannot see early posts..

    anybody could help me with idea where should I dig in?

  2. MichaelH
    Posted 6 years ago #

    See what happens with this:

    $cat_id = get_cat_ID('events');
      'cat' => $cat_id,
      'post_type' => 'post',
      'post_status' => 'publish',
      'showposts' => -1
    echo 'posts found '. count($catposts);

    Might also deactivate all plugins and change to WordPress Default theme.

Topic Closed

This topic has been closed to new replies.

About this Topic