Update functions.php

Simplified conditional check