Update functions.php

added curly braces to first 3 conditionals  - was causing blank pages error on aws and possilbly other servers