Added get_posts_count function.