Added validations for posts and pages