add post count by category function