Skip to content

Instantly share code, notes, and snippets.

@elioverbey
Created May 1, 2014 17:51
Show Gist options
  • Save elioverbey/49de7f73bebc52efe5b7 to your computer and use it in GitHub Desktop.
Save elioverbey/49de7f73bebc52efe5b7 to your computer and use it in GitHub Desktop.
<?php
//* Hook in Gigya Sharebar
add_action( 'genesis_entry_content', 'gigya_share', 9 );
function gigya_share() {
if ( ! is_singular( 'post' ) )
return;
?>
<script type="text/javascript">
var act = new gigya.socialize.UserAction();
act.setUserMessage("This is the user message");
act.setTitle("<?php echo get_the_title(); ?>");
act.setLinkBack("<?php echo get_permalink(); ?>");
act.setDescription("");
act.addActionLink("Watch this movie", "http://vimeo.com/24496773");
act.addMediaItem({ type: 'image', src: '<?php echo get_the_post_thumbnail($page->ID, 'thumbnail'); ?>', href: '<?php echo get_permalink(); ?>' });
var showShareBarUI_params=
{
containerID: 'componentDiv',
shareButtons: 'Facebook,googleplus-share,Pinterest,Twitter-Tweet,Email,Print',
userAction: act
}
</script>
<div id="componentDiv"></div>
<script type="text/javascript">
gigya.socialize.showShareBarUI(showShareBarUI_params);
</script>
<?php }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment