count results in search page based on custom category July 10, 2022 by Tarik Billa Have you tried wp_count_posts ? http://codex.wordpress.org/Function_Reference/wp_count_posts I think that will work here.