WordPress.org

Ready to get started?Download WordPress

Forums

found_posts is always zero (3 posts)

  1. revbob
    Member
    Posted 7 years ago #

    In link-template.php:

    function next_posts_link($label='Next Page »', $max_page=0) {
    global $paged, $wpdb, $wp_query;
    $foo = $wp_query->found_posts;
    echo "found_posts = " . $foo;
    if ( !$max_page ) {
    $max_page = $wp_query->max_num_pages;
    }

    and so on.

    This always prints a zero.

    Unless a max_page is supplied by the template, max_page (which is computed from found_posts in query.php) will be zero. Consequently, previous entries will never be shown.

  2. revbob
    Member
    Posted 7 years ago #

    Sorry, evidently the "Adhesive" plugin misbehaves on 2.1. When it's disabled the problem goes away.

  3. Chris_K
    Member
    Posted 7 years ago #

    Thanks for the follow-up. And hey, check here for an updated adhesive type plugin.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags