Skip to content

Instantly share code, notes, and snippets.

@jackreichert
Last active September 27, 2017 15:44
Show Gist options
  • Select an option

  • Save jackreichert/1832446 to your computer and use it in GitHub Desktop.

Select an option

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