Skip to content

Instantly share code, notes, and snippets.

@diego-betto
Last active September 26, 2017 14:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save diego-betto/8910522d5adb52fb87cb8abf29a8e697 to your computer and use it in GitHub Desktop.
Save diego-betto/8910522d5adb52fb87cb8abf29a8e697 to your computer and use it in GitHub Desktop.
Wordpress Theme: Inline Embed SVG files
<?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