Aller au contenu principal
Jetpack

Produits individuels

Sécurité
VaultPress Backup Scan Akismet Anti-spam
Performances
Recherche sur le site Boost VideoPress
Croissance
Stats Social Newsletter SEO Blaze CRM
Gestion
Manage Application mobile

Packs de produits

Pro Des outils de sécurité, de performance et de croissance pour votre site WordPress. Complet La suite Jetpack complète, avec des limites de service plus élevées.
Tarifs
Vue d’ensemble Ce que Jetpack AI fait pour votre site Skills Des super-pouvoirs WordPress pour votre agent Documentation Connecter et configurer votre agent IA Bien démarrer Connecter ChatGPT, Claude ou un agent de code Comparer Jetpack face aux autres connecteurs MCP pour WordPress

Connectez votre agent. C’est gratuit.

Connectez ChatGPT ou Claude et laissez-le gérer votre site, sans offre payante.

L’obtenir pour ChatGPT (s’ouvre dans un nouvel onglet) Ou utilisez Claude (s’ouvre dans un nouvel onglet)
Assistance Guides et aide de notre équipe Documentation Des tutoriels pour chaque fonctionnalité de Jetpack Demandes de fonctionnalités Request features and vote on ideas Blog Actualités, nouveautés produit et tutoriels
À propos
Se connecter Commencer
Sécurité
VaultPress Backup Scan Akismet Anti-spam
Performances
Recherche sur le site Boost VideoPress
Croissance
Stats Social Newsletter SEO Blaze CRM
Gestion
Manage Application mobile

Packs de produits

Pro Complet
Tarifs
Vue d’ensemble Ce que Jetpack AI fait pour votre site Skills Des super-pouvoirs WordPress pour votre agent Documentation Connecter et configurer votre agent IA Bien démarrer Connecter ChatGPT, Claude ou un agent de code Comparer Jetpack face aux autres connecteurs MCP pour WordPress

Connectez votre agent. C’est gratuit.

Connectez ChatGPT ou Claude et laissez-le gérer votre site, sans offre payante.

L’obtenir pour ChatGPT (s’ouvre dans un nouvel onglet) Ou utilisez Claude (s’ouvre dans un nouvel onglet)
Assistance Guides et aide de notre équipe Documentation Des tutoriels pour chaque fonctionnalité de Jetpack Demandes de fonctionnalités Request features and vote on ideas Blog Actualités, nouveautés produit et tutoriels
À propos Rechercher
Se connecter Commencer

Blog

Moving Sharing Icons

Avatar de Jeremy Herve

Jeremy Herve juin 10, 2013 · 2 min de lecture


If you use a block theme, you no longer need to use the code snippets below to customize the location of the sharing buttons on your site. You can use the Sharing buttons block to place the buttons anywhere you’d like in your theme.

One of the most common requests you send us is « Can we move the Sharing and Like buttons? » By default, the Sharing and Like buttons get printed at the end of the the_content() Loop function, which causes them to display at the end of your post’s text — but that may not be where you want them in your site’s design.

There are actually two ways to move the Sharing buttons and one for the Like button.

Move the Sharing and Like buttons

Jetpack, by default, just attaches this tag to two filters — the_content() and the_excerpt() — so that the Sharing icons get displayed. By editing your theme files, you can move the tag wherever you’d like — we default to attaching it to the filters so that, when the Sharing and Likes modules are activated, the buttons are displayed with no extra work. You’re free to move it around to put the Sharing icons where you’d like; here’s how:

In your functions.php file, add the following:

function jptweak_remove_share() {
    remove_filter( 'the_content', 'sharing_display', 19 );
    remove_filter( 'the_excerpt', 'sharing_display', 19 );
    if ( class_exists( 'Jetpack_Likes' ) ) {
        remove_filter( 'the_content', array( Jetpack_Likes::init(), 'post_likes' ), 30, 1 );
    }
}
add_action( 'loop_start', 'jptweak_remove_share' );

Find the file for the location where you’d like the sharing icons to appear and insert the following code in the area you want the Sharing or Likes buttons to appear:

if ( function_exists( 'sharing_display' ) ) {
    sharing_display( '', true );
}

if ( class_exists( 'Jetpack_Likes' ) ) {
    $custom_likes = new Jetpack_Likes;
    echo $custom_likes->post_likes( '' );
}

Note that you do not need to display these together; you can put sharing_display() in a separate place from the Likes display codeblock.

Move the Sharing Buttons via jQuery

This method comes via Beau Lebens, a fellow Automattician. He coded this jQuery method for moving the Sharing icons:

jQuery( document ).ready( function( $ ) {
    // Relocate Jetpack sharing buttons down into the comments form
    jQuery( '#sharing' ).html( jQuery( '.sharedaddy' ).detach() );
} );

The #sharing selector is just the DOM location where I want to move the buttons to, and the .sharedaddy one is the container that Jetpack places its buttons in normally. We just detach it from the normal position and then dump it into the new location exactly as it was.

We hope this helps you develop your theme and display things the way you like.

J’aime chargement…
  • #Did you know
  • #jquery
  • #sharedaddy
  • #sharing
Avatar de Jeremy Herve

Written by

Jeremy Herve

WordPress, TV Series, music, kids, and board games. I think that's probably the best way to define me in a few words. 🙂 I work at Automattic where I lead a team building tools for bloggers and creators. I talk a lot about WordPress things, but also about all things open source in general. I live in Brittany, France, so you'll also find me sharing pictures from our beautiful region from time to time.

Découvrez les avantages de Jetpack

Découvrez comment Jetpack peut vous aider à protéger, accélérer et développer votre site WordPress.

Découvrir les offres

Questions about this post? Ask in the support forum

Partager


Keep reading.

The latest from the Jetpack blog.

Voir tous les articles

Nov 24, 2026

Is the WordPress MCP server slow? I timed 160 calls on my own site.

I asked ChatGPT and Claude if Jetpack's MCP server is slow. Both said yes, and both pointed to the same test, one that put five everyday…

Avatar de Adam Pickering Adam Pickering 3 min de lecture

Nov 4, 2026

Everything that keeps your site safe, now on one page

Jetpack 16.4 brings Scan, Firewall, Login protection and Downtime monitoring together on one Protect page in wp-admin, so you can see whether your site is safe…

Avatar de Devin Walker Devin Walker 4 min de lecture

Nov 3, 2026

Jetpack 16.4 release: One Protect page, a new Backup dashboard, and more

All of Jetpack's security on one Protect page, a rebuilt Backup dashboard, Trim & cut for VideoPress, a new comment form, and the new Jetpack Pro…

Avatar de Devin Walker Devin Walker 3 min de lecture

Gérez votre site WordPress, l’IA d’abord.

Free to start, and AI agents are free to connect. Money back within 14 days on yearly plans.

Commencer Obtenir Jetpack gratuitement

Extensions WordPress

  • Akismet Anti-spam↗ (s’ouvre dans un nouvel onglet)
  • Jetpack↗ (s’ouvre dans un nouvel onglet)
  • Jetpack Boost↗ (s’ouvre dans un nouvel onglet)
  • Jetpack CRM↗ (s’ouvre dans un nouvel onglet)
  • Jetpack Protect↗ (s’ouvre dans un nouvel onglet)
  • Jetpack Search↗ (s’ouvre dans un nouvel onglet)
  • Jetpack Social↗ (s’ouvre dans un nouvel onglet)
  • Jetpack VideoPress↗ (s’ouvre dans un nouvel onglet)
  • VaultPress Backup↗ (s’ouvre dans un nouvel onglet)
  • WP Super Cache↗ (s’ouvre dans un nouvel onglet)
  • Télécharger

IA

  • Jetpack AI
  • Skills
  • WordPress MCP

Partenaires

  • Programme partenaires
  • Hébergeurs recommandés
  • Pour les hébergeurs
  • Pour les agences
  • Pour les affiliés

Développeurs

  • Documentation↗ (s’ouvre dans un nouvel onglet)
  • Programme bêta
  • Jetpack sur GitHub↗ (s’ouvre dans un nouvel onglet)

Aide

  • Base de connaissances
  • Forums↗ (s’ouvre dans un nouvel onglet)
  • Avis et témoignages
  • Nous contacter
  • À propos de Jetpack
  • Presse
Sélectionner la langue Français
  • English
  • Deutsch
  • Español
  • Français
  • 日本語

© 2026 Automattic Inc. Tous droits réservés.

  • Conditions d’utilisation↗ (s’ouvre dans un nouvel onglet)
  • Politique de confidentialité↗ (s’ouvre dans un nouvel onglet)
  • RGPD

Créé avec soin par

Télécharger dans l’App Store Disponible sur Google Play
  • Rebloguer
  • S'abonner Abonné
    Jetpack
    Rejoignez 53 352 autres abonnés

    Vous avez un compte WordPress.com ? Connectez-vous maintenant.

  • Jetpack
    Copier lien courtVoir la publication dans le Lecteur
    Gérer les abonnementsS’inscrireConnexion
    Signaler ce contenu
    Réduire cette barre
%d