Change site style→

style-1 style-2
  1. nazenani
  2. >
  3. >
  4. >
  5. >
  6. Trouble: Mismatch Search number.

Trouble: Mismatch Search number.

nazenani had been in troble.
The number got by $wp_query->found_posts and the number of posts got by WP_Query mismatched.

My conjection about cause of this trouble

$wp_query and WP_Query have defferent data?

So I tried to get search number by using WP_Query.

Before

After

Finally, search number and the number of posts matched!

Reference

WordPressの検索表示をカスタマイズする

comment

Fields with * is required.

go to related tags archive?