Title: Shortcode
Last modified: August 21, 2016

---

# Shortcode

 *  Resolved [Dance_a_lot](https://wordpress.org/support/users/dance_a_lot/)
 * (@dance_a_lot)
 * [12 years, 4 months ago](https://wordpress.org/support/topic/shortcode-132/)
 * Is there a shortcode so I can place the share buttons anywhere?
 * [http://wordpress.org/plugins/jetpack-sharing/](http://wordpress.org/plugins/jetpack-sharing/)

Viewing 5 replies - 1 through 5 (of 5 total)

 *  Thread Starter [Dance_a_lot](https://wordpress.org/support/users/dance_a_lot/)
 * (@dance_a_lot)
 * [12 years, 4 months ago](https://wordpress.org/support/topic/shortcode-132/#post-4517638)
 * Problem solved by using another plugin.
 *  [pax](https://wordpress.org/support/users/u8ik/)
 * (@u8ik)
 * [12 years, 3 months ago](https://wordpress.org/support/topic/shortcode-132/#post-4517690)
 * it would’ve been nice to specify which one you have chosen.
 *  [pax](https://wordpress.org/support/users/u8ik/)
 * (@u8ik)
 * [12 years, 3 months ago](https://wordpress.org/support/topic/shortcode-132/#post-4517691)
 * my quick dirty solution was configuring the share buttons I wanted, copying the
   generated HTML code, hiding the original share div via CSS then adding a `shareThis()`
   function whenever I needed it displayed.
 *     ```
       function shareThis(){
       $currentURL= 'http://'.$_SERVER["SERVER_NAME"].$_SERVER['REQUEST_URI'];
       echo '<div class="sharethis sharedaddy sd-sharing-enabled"><div class="robots-nocontent sd-block sd-social sd-social-icon-text sd-sharing"><h3 class="sd-title">Share this:</h3><div class="sd-content"><ul><li class="share-print"><a rel="nofollow" class="share-print sd-button share-icon" href="'.$currentURL.'" target="_blank" title="Click to print"><span>Print</span></a></li><li class="share-email share-service-visible"><a rel="nofollow" class="share-email sd-button share-icon" href="'.$currentURL.'?share=email&nb=1" target="_blank" title="Click to email this to a friend"><span>Email</span></a></li><li class="share-twitter"><a rel="nofollow" class="share-twitter sd-button share-icon" href="'.$currentURL.'?share=twitter&nb=1" target="_blank" title="Click to share on Twitter" id="sharing-twitter-56"><span>Twitter</span></a></li><li><a href="#" class="sharing-anchor sd-button share-more"><span>More</span></a></li><li class="share-end"></li></ul><div class="sharing-hidden"><div class="inner" style="overflow: hidden; left: 654.75px; top: 799.6875px;"><ul><li class="share-linkedin"><a rel="nofollow" class="share-linkedin sd-button share-icon" href="'.$currentURL.'?share=linkedin&nb=1" target="_blank" title="Click to share on LinkedIn" id="sharing-linkedin-56"><span>LinkedIn</span></a></li><li class="share-google-plus-1"><a rel="nofollow" class="share-google-plus-1 sd-button share-icon" href="'.$currentURL.'?share=google-plus-1&nb=1" target="_blank" title="Click to share on Google+" id="sharing-google-56"><span>Google</span></a></li><li class="share-end"></li><li class="share-facebook"><a rel="nofollow" class="share-facebook sd-button share-icon" href="'.$currentURL.'?share=facebook&nb=1" target="_blank" title="Share on Facebook" id="sharing-facebook-56"><span>Facebook</span></a></li><li class="share-pocket"><a rel="nofollow" class="share-pocket sd-button share-icon" href="'.$currentURL.'?share=pocket&nb=1" target="_blank" title="Click to share on Pocket"><span>Pocket</span></a></li><li class="share-end"></li><li class="share-end"></li></ul></div></div></div></div></div>';
       }
       ```
   
 * and this css:
 *     ```
       .sharedaddy {display: none;} /* hide default sharing widget*/
       .sharedaddy.sharethis {display: block; } /* show my sharing widget */
       .sharedaddy.sharethis .inner {display: none}
       ```
   
 * Of course the plugin needs to be activated for all the page types I want it visible
   in – so it loads the required CSS and js – which I was too lazy to load separately–
   though that would be a bit more elegant.
 * Instead a function (useful in a template) one could pretty easily add a shortcode.
 *  [olie480](https://wordpress.org/support/users/olie480/)
 * (@olie480)
 * [12 years, 1 month ago](https://wordpress.org/support/topic/shortcode-132/#post-4517708)
 * Alright, I’ve been trying to do the same thing, and I finally found a solution
   to this. Hacking it is definitely fun, but this is a quick logical way to place
   the code where you want.
 * Thanks to andersbalari:
 *     ```
       <!-- remove the plugins' version of the sharing icons -->
       <?php remove_filter( 'the_content', 'sharing_display', 19 ); ?>
       <?php remove_filter( 'the_excerpt', 'sharing_display', 19 ); ?>
   
       <!-- this is the function to display the social icons you picked in the admin -->
       <?php echo sharing_display(); ?>
   
       <!-- display the content -->
       <?php the_content(); ?>
       ```
   
 * Explained by andersbalari here [http://wordpress.org/support/topic/custom-placement-of-jetpackssharedaddys-sharing](http://wordpress.org/support/topic/custom-placement-of-jetpackssharedaddys-sharing)
 *  [cmmmc](https://wordpress.org/support/users/cmmmc/)
 * (@cmmmc)
 * [11 years, 10 months ago](https://wordpress.org/support/topic/shortcode-132/#post-4517717)
 * Isn’t there a simple [sharethis] shortcode that can be called? I tried to wrap
   my head around this… but failed 🙂
 * Thanks!

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘Shortcode’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/jetpack-sharing.svg)
 * [JP Sharing](https://wordpress.org/plugins/jetpack-sharing/)
 * [Support Threads](https://wordpress.org/support/plugin/jetpack-sharing/)
 * [Active Topics](https://wordpress.org/support/plugin/jetpack-sharing/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/jetpack-sharing/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/jetpack-sharing/reviews/)

## Tags

 * [sharing](https://wordpress.org/support/topic-tag/sharing/)
 * [shortcode](https://wordpress.org/support/topic-tag/shortcode/)

 * 5 replies
 * 4 participants
 * Last reply from: [cmmmc](https://wordpress.org/support/users/cmmmc/)
 * Last activity: [11 years, 10 months ago](https://wordpress.org/support/topic/shortcode-132/#post-4517717)
 * Status: resolved