Fixe Undefined Variable error in Blog Functions