Skip to content

Instantly share code, notes, and snippets.

@digisavvy
Created August 7, 2014 19:13
Show Gist options
  • Save digisavvy/a2e92d80edd843a1ddc9 to your computer and use it in GitHub Desktop.
Save digisavvy/a2e92d80edd843a1ddc9 to your computer and use it in GitHub Desktop.
<?php
add_filter( 'soliloquy_output_slide', 'tgm_soliloquy_custom_html', 10, 4 );
function tgm_soliloquy_custom_html( $html, $id, $image, $data ) {
// If the ID doesn't match the one we want to modify, return the default HTML output. Change 324 to your slider ID.
$slider_id = $data['id'];
ob_start(); ?>
<span class="social-m">
<?php $summary = get_field('short_description');?>
<a onClick="window.open('http://www.facebook.com/sharer.php?s=100&amp;p[title]=<?php the_title();?>&amp;p[summary]=<?php echo $summary;?>&amp;p[url]=<?php the_permalink();?>&amp;&amp;p[images][0]=<?php echo $image['sizes']['recipe-list'];?>','sharer','toolbar=0,status=0,width=548,height=325');" href="javascript: void(0)"><img class="facebook fade" src="<?php bloginfo('template_directory');?>/images/share-fb.png" width="20" height="20" alt="Share this message on Facebook" /></a>
<a onclick="window.open(this.href);return false;" href="http://pinterest.com/pin/create/button/?url=<?php the_permalink();?>&media=<?php echo $image['sizes']['recipe-list']; ?>&description=<?php the_field('recipe_description'); ?>" class="pin-it-button" count-layout="none"><img border="0" src="<?php bloginfo('template_directory');?>/images/share-pnt.png" title="Pin It" /></a>
<a href="http://twitter.com/share?text=<?php the_field('recipe_description'); ?>&url=<?php the_permalink();?>" target="_blank"><img src="<?php bloginfo('template_directory');?>/images/share-tw.png" width="20" height="20" alt="" /></a>
</span>
<?php
$html = ob_get_contents();
ob_end_clean();
if ( '1937' == $slider_id ) {
// $html .= '<div class="addthis_sharing_toolbox"></div>';
return $html;
} else {
// $html .= '<div><p>Hello World!</p></div>';
return $html;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment