WordPress.org

Support

Support » Plugins and Hacks » found_posts count is wrong if its paginated

found_posts count is wrong if its paginated

Viewing 3 replies - 1 through 3 (of 3 total)
  • I am experiencing the same issue:

    http://connectedfamilies.org/tag/podcast/page/3/

    there are 23 posts, but the count for the “podcast” tag is showing up as 3 on page 3, (pages 1 and 2 it’s each 10, because the count is 10, and then 3 is the remainder on page 3)

    Let me know if a fix is upcoming for this. If there’s not one, perhaps I’ll poke around to try and figure out why. Finding and fixing the issue would be my most impressive code-related feat so far, but hey, why not? 🙂 Because this will definitely confuse my visitors trying to understand and use the widget.

    Thanks for a sweet plugin,

    Hi,

    for plugin version 1.2.6,
    in walkers.php,
    function count() (line 28):

    return $GLOBALS['wp_query']->post_count;

    changing post_count to found_posts seems to correct the selected terms count issue, when using pagination on WP.
    At least for me.

    Code:

    ...
        function count() {
            $old_query = qmt_get_query();
    
            if ( $this->data['is-selected'] ) {
                //return $GLOBALS['wp_query']->post_count;
    	    return $GLOBALS['wp_query']->found_posts;
            }
    
            $query = array(
                'tax_query' => array(
    ...

    Approved. Changed necessary line in first post’s example site and its working properly now. Thank you @atti_simon

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘found_posts count is wrong if its paginated’ is closed to new replies.