Skip to content

Instantly share code, notes, and snippets.

@jeherve

jeherve/plugin.php

Created Nov 16, 2015
Embed
What would you like to do?
[Jetpack] Move Jetpack's sharing buttons from their default location to right under Woocommerce's product image.
<?php
/**
* Move Jetpack's sharing buttons from their default location to right under Woocommerce's product image
*
* @see http://jetpack.me/2013/06/10/moving-sharing-icons/
* @see http://businessbloomer.com/woocommerce-move-jetpack-social-sharing-single-product-page-tabs/ for an alternative placement
*/
function jeherve_move_jp_sharing_icons_woo() {
// Start by checking if Jetpack's sharing buttons are actually in use on the site
if ( function_exists( 'sharing_display' ) ) {
// Remove the buttons from their default location
remove_filter( 'the_content', 'sharing_display', 19 );
remove_filter( 'the_excerpt', 'sharing_display', 19 );
// Add them back.
echo sharing_display();
}
}
add_action( 'woocommerce_before_single_product_summary','jeherve_move_jp_sharing_icons_woo', 21 );
@thiagoprogramador

This comment has been minimized.

Copy link

@thiagoprogramador thiagoprogramador commented Jul 18, 2017

This code, you insert into functions.php?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.