Exclude Digg Digg From Select Pages

I use the Digg Digg Social Media sharing plugin, but there are pages (Contact Me page, for example) I don’t want the sharing buttons to appear.

Here’s the code I used (and where I added it) to exclude DiggDigg from select pages:

  1. Access your active WordPress theme and open the functions.php file.
  2. Paste the code snippet below into the file
  3. Replace the “1, 2, 3, 4” after the “if(is_page(array(” part of the code with your post number(s) and save.

[code type=”php”]
/** Exclude DiggDigg From Select Pages */
function eo_exclude_digg_digg() {
if(is_page(array(1, 2, 3, 4))) {
remove_filter(‘the_excerpt’, ‘dd_hook_wp_content’);
remove_filter(‘the_content’, ‘dd_hook_wp_content’);
add_action(‘template_redirect’, ‘eo_exclude_digg_digg’);

Remove Search Box on WordPress Admin Bar
Blog vs. Facebook Page... What to Post Where?

MarketingChick.com is a participant in the Amazon Services LLC Associates Program, an affiliate advertising program designed to provide a means for sites to earn advertising fees by advertising and linking to Amazon.com.

Send this to a friend