Add logic to get the posts count