WordPress.org

Support

Support » How-To and Troubleshooting » Post count different from search results…

Post count different from search results…

  • So, I’ve got landing pages for each of my custom taxonomies (restaurant review site so ‘cuisines’ etc), and I use the following to get the post count for each of them when I make the list…

    $args = array(
    ‘taxonomy’ => ‘cuisine’,
    ‘show_count’ => true,
    ‘hierarchical’ => true,
    ‘echo’ => ‘0’,
    ‘title_li’ => NULL,
    ‘child_of’ => $term->term_id,
    ‘pad_counts’ => 0
    );
    echo wp_list_categories($args);

    … which gives a list with a count of the number of posts in each category. Clicking these items takes you to a search result page, which shows all the posts in that category, as it should. The problem is the number of posts is reported differently in each case. For example clicking…

    Pizza (12)

    … takes you to a search result page which uses the following…

    $search_object->found_posts;

    … to give the number of results. In this case the search results page shows 11 NOT 12! Why? In the admin area I get the same; the number next to ‘pizza’ says ’12’, but clicking it shows exactly 11 results…

    Can anyone help me?!? I’m going mad here…

    Thanks,

    J

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘Post count different from search results…’ is closed to new replies.
Skip to toolbar