To give you an ad-free browsing experience, this website is completely funded by donations. If you use the information in this article to solve a problem, entertain yourself, or otherwise improve your life, please consider a small donation to help pay for server costs. Many thanks, and enjoy the site!

Scraps

Using the WP-Print and Sociable Plugins Together

Two excellent WordPress Plugins are WP-Print by Lester Chan and Sociable by Joost de Valk.  Unfortunately, these two plugins don’t play nicely together.  To prevent any Sociable links/images from being printed from a WP-Print screen, first disable automatic placement of Sociable from the Sociable admin page.  Next, paste the following PHP code into the Single Post file of your theme (at the location where you want sociable to appear):

<?php do_shortcode(‘[donotprint]’); ?><?php if (function_exists(’sociable_html’)) { echo sociable_html(); } ?><?php do_shortcode(‘[/donotprint]’); ?>

…then repeat this for any other template pages where you want Sociable to appear!

Note: This article is part of the "Scraps" category. I use scraps to pass along interesting snippets, tidbits, and links - so don't be alarmed if the article is short!

 

Related articles:

Discussion (Oldest Comments Displayed First)

3 comments on “Using the WP-Print and Sociable Plugins Together”

  1. Great post, thanks a lot.

    I had to change the two (^) parts to [donotprint] and [/donotprint] though for it to work.

    Posted by Alex | February 18, 2009, 12:41 pm
  2. Thanks for the tip, Alex – the brackets should be fixed now.

    Posted by Tanner | February 18, 2009, 1:48 pm
  3. Thanks Alex!

    Your idea inspired me: If your want to integrate WP-Print into Sociable just put following code into the location section in “sociable.php”:

    'WP-Print' => Array(
    'favicon' => 'printer.png',
    'url' => 'print',
    'description' => 'Print',
    ),

    Like that you can even arrange the WP-Print icon within the Sociable admin panel.

    Posted by Daniel | June 27, 2009, 8:09 am

Post a comment

Feel free to use any of these tags in your comment: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>