WordPress.org

Ready to get started?Download WordPress

Forums

Query Multiple Taxonomies
found_posts count is wrong if its paginated (4 posts)

  1. Unsal Korkmaz
    Member
    Posted 1 year ago #

    I didnt check codes for what is wrong. but there is a live example:

    http://kremim.com/marka/bioderma/konu/temizleyici-urunler/
    This page using 2 tax filter;
    * 1 "marka" taxonomy as "bioderma"
    * 1 "konu" taxonomy as "temizleyici-urunler"

    $wp_query->found_posts result is 29 but plugin shows 15 because system pagination is 15.

    http://wordpress.org/extend/plugins/query-multiple-taxonomies/
    using 1.6.2 version

  2. dannyjimmy
    Member
    Posted 1 year ago #

    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,

  3. atti_simon
    Member
    Posted 1 year ago #

    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(
    ...
  4. Unsal Korkmaz
    Member
    Posted 1 year ago #

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

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.