I 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'); |
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
Not a problem Steve 🙂 Glad it helped!
where the functions.php file for editing?
You’ll find it in your theme’s root directory wp-content/themes/your-theme/functions.php
I was searching a way for stop showing diggdigg on my mobile pages and finally I found solution.
http://www.stuckngo.com/52/how-to-hide-diggdigg-from-mobile-template
Only one line of code inside css make my day better 🙂
Cheers Josh, works a treat!
Thanks for that solution – it definitely helped me on my store.