Skip to content

Instantly share code, notes, and snippets.

@jackreichert
Last active September 27, 2017 15:44
Show Gist options
  • Save jackreichert/1832446 to your computer and use it in GitHub Desktop.
Save jackreichert/1832446 to your computer and use it in GitHub Desktop.
WordPress Gist ShortCode
// github gist Shortcode Usage: [gist un="" id=""]
function gist_shortcode( $atts ) {
extract(shortcode_atts(array(
'un' => '',
'id' => ''
), $atts));
return '<script src="https://gist.github.com/' . $username . '/' . $id.'.js"></script>';
}
add_shortcode('gist', 'gist_shortcode');
@jackreichert
Copy link
Author

The gist creates the proper embed code, but the script on github's end doesn't seem to be working anymore. I'll update if it does.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment