Add logic to get the post count