Skip to content

Instantly share code, notes, and snippets.

@lynettechandler
Last active December 24, 2015 00:39
Show Gist options
  • Save lynettechandler/6717721 to your computer and use it in GitHub Desktop.
Save lynettechandler/6717721 to your computer and use it in GitHub Desktop.
Slideshare shortcode for self hosted WordPress
// Add slideshare shortcode
function tbm_slideshare( $atts ) {
$atts = extract( shortcode_atts(
array(
'id'=>''
),$atts ) );
// Break it up so we can get the first variable = presentation ID
$id = explode('&', $id);
return '<iframe src="http://www.slideshare.net/slideshow/embed_code/'.$id[0].'?rel=0" width="570" height="469" frameborder="0" marginwidth="0" marginheight="0" scrolling="no" style="border:1px solid #CCC;border-width:1px 1px 0;margin-bottom:5px" allowfullscreen webkitallowfullscreen mozallowfullscreen> </iframe>';
}
add_shortcode( 'slideshare','tbm_slideshare' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment