Reducing duplication and better utilizing the WP built-in `locate_template()`

Re recommendations from @QWp6t in roots/roots#1042