Last active
December 27, 2017 11:24
-
-
Save teemujonkkari/a006286f6018422001989f881f2ab636 to your computer and use it in GitHub Desktop.
WordPress Jetpack Sharing (Sharedaddy) Shortcode
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// This shortcode will show the buttons you have actived through sharing settings. | |
// Add this shortcode function to functions.php file in your theme folder | |
function wpcodex_sharedaddy_shortcode() { | |
return ( class_exists( 'Jetpack' ) && Jetpack::is_module_active( 'sharedaddy' ) ) ? sharing_display() : ''; | |
} | |
add_shortcode( 'sharedaddy_buttons', 'wpcodex_sharedaddy_shortcode' ); | |
// Add this shortcode to your theme where ever you want to show the sharing buttons | |
// [sharedaddy_buttons] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment