Trusted WordPress tutorials, when you need them most.
Beginner’s Guide to WordPress
Coppa WPB
25 Million+
Websites using our plugins
16+
Years of WordPress experience
3000+
WordPress tutorials
by experts

Come aggiungere il pulsante di condivisione ufficiale di LinkedIn in WordPress

Nota editoriale: guadagniamo una commissione dai link dei partner su WPBeginner. Le commissioni non influenzano le opinioni o le valutazioni dei nostri redattori. Per saperne di più su Processo editoriale.

Volete aggiungere il pulsante di condivisione ufficiale di LinkedIn in WordPress? Esistono molti plugin per i social media che consentono di aggiungere pulsanti di condivisione, ma la maggior parte di essi non utilizza i pulsanti ufficiali. In questo articolo vi mostreremo come aggiungere il pulsante di condivisione ufficiale di LinkedIn in WordPress.

Adding LinkedIn share button in WordPress

Aggiunta del pulsante di condivisione ufficiale di LinkedIn in WordPress

Per questa esercitazione è necessario modificare i file del tema di WordPress. Se non l’avete mai fatto prima, consultate la nostra guida su come copiare e incollare il codice in WordPress.

Per prima cosa, è necessario visitare la pagina del plugin LinkedIn Share. Vi verrà chiesto di selezionare la lingua del vostro sito e lo stile del pulsante che volete utilizzare.

Il campo URL può essere lasciato vuoto perché il pulsante di condivisione può ottenere automaticamente l’URL della pagina.

Successivamente, è necessario fare clic sul pulsante “Ottieni codice” per copiare il codice del pulsante di condivisione di LinkedIn.

Copy the LinkedIn share button code

Ora che abbiamo ottenuto il codice di condivisione, aggiungiamo i pulsanti ufficiali al vostro sito WordPress.

Visualizzare il pulsante di condivisione di LinkedIn nei post e nelle pagine di WordPress

Se volete visualizzare il pulsante di condivisione di LinkedIn prima del contenuto del vostro post, potete utilizzare il seguente codice. Dovrete copiare e incollare questo codice nel file functions.php del vostro tema o in un plugin specifico del sito.

function wpb_linkedin_share_before($content) { 
// Share code you copied from LinkedIn goes here
$sharecode .= '<script src="//platform.linkedin.com/in.js" type="text/javascript"> lang: en_US</script>
<script type="IN/Share" data-counter="top"></script>'; 
$newcontent = $sharecode .$content; 
return $newcontent; 
} 
add_filter('the_content', 'wpb_linkedin_share_before');

Potete salvare le modifiche e visitare il vostro sito web per vederlo in azione.

LinkedIn Share button in action

Se si desidera visualizzare il pulsante di condivisione dopo il contenuto del post, è necessario aggiungere il seguente codice.


function wpb_linkedin_share_after($content) { 
$sharecode .= '<script src="//platform.linkedin.com/in.js" type="text/javascript"> lang: en_US</script>
<script type="IN/Share" data-counter="top"></script>'; 
$newcontent = $content . $sharecode; 
return $newcontent; 
} 
add_filter('the_content', 'wpb_linkedin_share_after');

Potete anche aggiungere il codice del pulsante di condivisione di LinkedIn copiato in precedenza direttamente in un widget HTML personalizzato di WordPress. Basta visitare la pagina Aspetto ” Widget e aggiungere il widget ‘HTML personalizzato’ a una barra laterale.

Quindi, aggiungete il codice del pulsante di condivisione di LinkedIn all’interno del widget HTML personalizzato e fate clic sul pulsante Salva per memorizzare le modifiche.

Linkedin button in a sidebar widget

Ora potete visitare il vostro sito web per vederlo in azione.

LinkedIn share button in sidebar

Speriamo che questo articolo vi abbia aiutato a capire come aggiungere facilmente il pulsante di condivisione ufficiale di LinkedIn in WordPress. Potreste anche voler consultare il nostro elenco dei migliori plugin LinkedIn per WordPress.

Se vi è piaciuto questo articolo, iscrivetevi al nostro canale YouTube per i video tutorial su WordPress. Potete trovarci anche su Twitter e Facebook.

Divulgazione: I nostri contenuti sono sostenuti dai lettori. Ciò significa che se cliccate su alcuni dei nostri link, potremmo guadagnare una commissione. Vedi come WPBeginner è finanziato , perché è importante e come puoi sostenerci. Ecco il nostro processo editoriale .

Avatar

Editorial Staff at WPBeginner is a team of WordPress experts led by Syed Balkhi with over 16 years of experience in WordPress, Web Hosting, eCommerce, SEO, and Marketing. Started in 2009, WPBeginner is now the largest free WordPress resource site in the industry and is often referred to as the Wikipedia for WordPress.

Il kit di strumenti WordPress definitivo

Ottenete l'accesso gratuito al nostro kit di strumenti - una raccolta di prodotti e risorse relative a WordPress che ogni professionista dovrebbe avere!

Reader Interactions

29 commentiLascia una risposta

  1. Syed Balkhi says

    Hey WPBeginner readers,
    Did you know you can win exciting prizes by commenting on WPBeginner?
    Every month, our top blog commenters will win HUGE rewards, including premium WordPress plugin licenses and cash prizes.
    You can get more details about the contest from here.
    Start sharing your thoughts below to stand a chance to win!

  2. Sanket Bhardwaj says

    Hey, Thanks for providing this code. I have added this button on my website but now when i want to remove this It came back again and again. I have removed the code from functions.php but it came again and again.
    Please help Me.

  3. Gabriela says

    Anyone know why when you share your blog here in WordPress to LinkedIn, there is no picture attached? I do have one but it disappears when I try to share it to LinkedIn. I shared it in Facebook and Twitter and it works good but not in LinkedIn, The text appears good but no picture. I don’t get it. Tips? Thank you!

  4. Emily says

    Does anyone know of a way to add the LinkedIn share button to a “free” wordpress, for which I own the domaine? Not sure if this matters, but I think maybe the other company is “hosting” the wordpress page. Anyway, I’ve tried the text widget and adding the html to the end of a blog post. Don’t think either is working because I just get a weird looking hyperlink that takes someone to a page of text….

  5. Electra Ford says

    Hi,

    I’ve added the code but it’s not showing for me. Any new updates on how to get the LinkedIn share button to display?

    Thanks

  6. sinhrakesh says

    I used below codes in the Custom Codes section to add Google+ and Linkedin Share buttons on my WP Blog (www.maintec.com/blog):

    Google+

    <div class=”sharer”><script type=”text/javascript” src=”https://apis.google.com/js/plusone.js”></script> <g:plusone size=”tall”></g:plusone></div>

    Linkedin

    <div class=”sharer”><script type=”text/javascript” src=”http://platform.linkedin.com/in.js”></script><script type=”in/share” data-url=”<?php the_permalink(); ?>” data-counter=”top”></script></div>

    Google+ Button is working fine but Linkedin Share isn’t getting the desired result upon clicking… Can you please advise whats wrong where?

  7. wpbeginner says

    You are welcome. Yes horizontal one works great, but if you have a floating share box like ours, then the vertical share box is good too.

  8. Keith Aul says

    I’m not to sure what you mean by the following?
    To add the Official Linkedin Share button simply open up a theme file of your choice (single.php etc) and add the following code within the Post Loop

    I don’t want to break anything on my site so I want to be sure I’m able to find the right file and open/edit it. Where would I find the theme file in my dashboard and where in the file do I post the code?

    • Editorial Staff says

      You will find the theme file in your theme’s folder wp-content/themes/yourthemename/ < Editor and edit single.php file. If you have no knowledge regarding WordPress, then we recommend that you wait till a plugin comes out.

      Admin

  9. Piet says

    Finally LinkedIn did this, a week too late though, but I managed to make something similar for myself.
    Next time I need it, I will just grab your code, thanks!

    • Jose Joel says

      The Share This Plugin have the option to add the LinkedIn Button as simple as writing linkedin the editing section of the plugin…and this one have count… ;)

      Note: I’m not the developer of this plugin, neither work for them, I’m only a regular user… :)

  10. Jon Bishop says

    I’m happy LinkedIn finally did this. I tried to use their API to make my own for the Socialize plugin but it ended up being a pain. I was able to finally use this code to update the plugin with the new LinkedIn button.

Lascia una risposta

Grazie per aver scelto di lasciare un commento. Tenga presente che tutti i commenti sono moderati in base alle nostre politica dei commenti e il suo indirizzo e-mail NON sarà pubblicato. Si prega di NON utilizzare parole chiave nel campo del nome. Avremo una conversazione personale e significativa.