Fixes #50 weird logic in functions.php

Moved the `if`, modified the existing one and removed `$path` as it's never set.