Skip to content

Instantly share code, notes, and snippets.

@billerickson
Created September 14, 2018 16:12
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 billerickson/8baa8cd8b211d1e0ec161756708b0d81 to your computer and use it in GitHub Desktop.
Save billerickson/8baa8cd8b211d1e0ec161756708b0d81 to your computer and use it in GitHub Desktop.
<?php
/**
* Share Recipe Shortcode
*
*/
function ea_share_recipe_shortcode() {
if( ! function_exists( 'shared_counts' ) )
return;
$output = '<aside class="inpost-share-recipe">';
$output .= '<h2>Like this recipe? Share it!</h2>';
$output .= '<p>';
$output .= shared_counts()->front->link( 'pinterest', false, false, 'button' );
$output .= shared_counts()->front->link( 'facebook_shares', false, false, 'button' );
$output .= shared_counts()->front->link( 'email', false, false, 'button' );
$output .= '</p></aside>';
return $output;
}
add_shortcode( 'share_recipe', 'ea_share_recipe_shortcode' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment