adding category  count and more posts model function