Skip to content

Instantly share code, notes, and snippets.

@gallib
Last active December 16, 2015 01:49
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 gallib/5358224 to your computer and use it in GitHub Desktop.
Save gallib/5358224 to your computer and use it in GitHub Desktop.
A placer dans functions.php. Utilisation: [gist id="xxx"]
function embed_gist( $atts ) {
// Attributes
extract( shortcode_atts(
array(
'id' => '',
), $atts )
);
// Code
return '<script src="https://gist.github.com/' . $atts['id'] . '.js"></script>';
}
add_shortcode( 'gist', 'embed_gist' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment