How To Remove Digg Digg Floating Share Bar From WooCommerce Products

How To Remove Digg Digg From WooCommerce ProductsI love the Digg Digg social sharing plugin for WordPress and put it on just about every site that I build (including this one).

It floats nicely down the page and is such a slick looking way to get people to interact with your blog posts on social media.

But there’s a couple of shortcomings with the plugin and the guys from Buffer (who now own the plugin) obviously don’t have a boat load of extra time dedicated to fixing them.

One such shortcoming is that it doesn’t handle custom post types very well, in particular for me the main annoyance was having Digg Digg’s floating share bar show on all WooCommerce product pages.

I came up with this short code snippet to get it to stop showing on any WooCommerce related page, feel free to use it in your functions.php:

function dd_exclude_from_woocommerce() {
	if(is_woocommerce()) {
		remove_filter('the_excerpt', 'dd_hook_wp_content');
		remove_filter('the_content', 'dd_hook_wp_content');
	}
}
add_action('template_redirect', 'dd_exclude_from_woocommerce');

Looking for a coding job? See our job listings page. Click here to view →

About Josh Kohlbach

Josh is a programmer, entrepreneur and the founder of Code My Own Road. He started this website to help programmers with business stuff and also to get things straight in his head. You can read more about Code My Own Road and Josh on the About page

4 Responses to How To Remove Digg Digg Floating Share Bar From WooCommerce Products

  1. steve garth September 12, 2013 at 10:56 am #

    Hi Josh,

    You saved my life! I’m with you – I love Digg Digg but it doesn’t play well with Woocommerce.

    Thanks for sharing!

    All the best

    Steve

    • Josh Kohlbach September 12, 2013 at 11:00 am #

      Not a problem Steve :) Glad it helped!

  2. Arman February 6, 2014 at 4:06 am #

    where the functions.php file for editing?

    • Josh Kohlbach February 12, 2014 at 2:18 pm #

      You’ll find it in your theme’s root directory wp-content/themes/your-theme/functions.php

Leave a Reply

Read more:
Circumventing The Law Of Line Extension

Continuing our discussion on the book 22 Immutable Laws Of Marketing by Al Ries and Jack Trout which I'm reading...

Close