Created
July 21, 2017 14:55
-
-
Save richtabor/2a1b1175234a30dc7ce75e0a71e536c6 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if(!function_exists('get_theme_file_uri')){ | |
function get_theme_file_uri( $file = '' ) { | |
$file = ltrim( $file, '/' ); | |
if ( empty( $file ) ) { | |
$url = get_stylesheet_directory_uri(); | |
} elseif ( file_exists( get_stylesheet_directory() . '/' . $file ) ) { | |
$url = get_stylesheet_directory_uri() . '/' . $file; | |
} else { | |
$url = get_template_directory_uri() . '/' . $file; | |
} | |
return apply_filters( 'theme_file_uri', $url, $file ); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment