Get posts from database