Get posts from database.