WordPress.org

Support

Support » How-To and Troubleshooting » [Resolved] found_posts is 0, but posts are being displayed

[Resolved] found_posts is 0, but posts are being displayed

  • I have 2 sites, on 2 different hosts and databases, both running php5. On one site $wp_query->found_posts returns a proper value, but on the other one it always returns 0, even though posts are being displayed and value in $wp_query->post_count is correct. They’re using the exact same template files, they both have 20 posts and are configured to display 5 on a page.

    Apart from that, all other features work fine on both sites.

    For testing, I created an archive.php file, with no extra plugins or functions, with a single line of code giving different results on 2 sites:

    <?php echo $wp_query->found_posts; ?>

    I would greatly appreciate any help, as I am completely baffled.

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘[Resolved] found_posts is 0, but posts are being displayed’ is closed to new replies.