Last active
September 26, 2017 14:16
-
-
Save diego-betto/8910522d5adb52fb87cb8abf29a8e697 to your computer and use it in GitHub Desktop.
Wordpress Theme: Inline Embed SVG files
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
<?php | |
// in functions.php | |
function inlineSvg($file) | |
{ | |
$theFile = get_template_directory().'/'.$file.'.svg'; | |
echo (is_file($theFile) ? file_get_contents(get_template_directory().'/'.$file.'.svg') : ''); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment