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

Wie man den offiziellen LinkedIn Share Button in WordPress hinzufügt

Hinweis der Redaktion: Wir erhalten eine Provision für Partnerlinks auf WPBeginner. Die Provisionen haben keinen Einfluss auf die Meinung oder Bewertung unserer Redakteure. Erfahre mehr über Redaktioneller Prozess.

Möchten Sie den offiziellen LinkedIn Share-Button in WordPress hinzufügen? Es gibt viele Social-Media-Plugins, mit denen Sie Share-Buttons hinzufügen können, aber die meisten von ihnen verwenden nicht die offiziellen Buttons. In diesem Artikel zeigen wir Ihnen, wie Sie den offiziellen LinkedIn-Share-Button in WordPress hinzufügen können.

Adding LinkedIn share button in WordPress

Hinzufügen des offiziellen LinkedIn Share-Buttons in WordPress

Für dieses Tutorial müssen Sie Ihre WordPress-Theme-Dateien bearbeiten. Wenn Sie dies noch nicht getan haben, lesen Sie unsere Anleitung zum Kopieren und Einfügen von Code in WordPress.

Zuerst müssen Sie die LinkedIn Share Plugin-Seite besuchen. Sie werden aufgefordert, die Sprache Ihrer Website und den Stil der Schaltfläche, die Sie verwenden möchten, auszuwählen.

Sie können das URL-Feld leer lassen, da die Freigabe-Schaltfläche automatisch die URL der Seite abrufen kann.

Als Nächstes müssen Sie auf die Schaltfläche „Code holen“ klicken, um den Code für die LinkedIn Share-Schaltfläche zu kopieren.

Copy the LinkedIn share button code

Nun, da wir den Freigabecode haben, fügen wir die offiziellen Schaltflächen auf Ihrer WordPress-Website hinzu.

LinkedIn Share Button in WordPress Posts und Seiten anzeigen

Wenn Sie die LinkedIn Share-Schaltfläche vor dem Inhalt Ihres Beitrags anzeigen möchten, können Sie den folgenden Code verwenden. Kopieren Sie diesen Code und fügen Sie ihn in die Datei functions.php Ihres Themes oder in ein Site-spezifisches Plugin ein.

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');

Speichern Sie die Änderungen und besuchen Sie Ihre Website, um sie in Aktion zu sehen.

LinkedIn Share button in action

Wenn Sie die Schaltfläche zum Teilen nach dem Inhalt Ihres Beitrags anzeigen möchten, müssen Sie stattdessen den folgenden Code hinzufügen.


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');

Sie können den zuvor kopierten Code für die LinkedIn Share-Schaltfläche auch direkt in ein benutzerdefiniertes HTML-Widget von WordPress einfügen. Gehen Sie einfach auf die Seite Erscheinungsbild “ Widgets und fügen Sie das „Custom HTML“-Widget in eine Seitenleiste ein.

Fügen Sie dann den Code für die LinkedIn Share-Schaltfläche in das benutzerdefinierte HTML-Widget ein und klicken Sie auf die Schaltfläche „Speichern“, um Ihre Änderungen zu speichern.

Linkedin button in a sidebar widget

Sie können nun Ihre Website besuchen, um sie in Aktion zu sehen.

LinkedIn share button in sidebar

Wir hoffen, dass dieser Artikel Ihnen geholfen hat zu lernen, wie Sie den offiziellen LinkedIn Share-Button in WordPress einfach hinzufügen können. Vielleicht interessieren Sie sich auch für unsere Liste der besten LinkedIn-Plugins für WordPress.

Wenn Ihnen dieser Artikel gefallen hat, dann abonnieren Sie bitte unseren YouTube-Kanal für WordPress-Videotutorials. Sie können uns auch auf Twitter und Facebook finden.

Offenlegung: Unsere Inhalte werden von unseren Lesern unterstützt. Das bedeutet, dass wir möglicherweise eine Provision verdienen, wenn Sie auf einige unserer Links klicken. Mehr dazu erfahren Sie unter Wie WPBeginner finanziert wird , warum das wichtig ist und wie Sie uns unterstützen können. Hier finden Sie unseren redaktionellen Prozess .

Das ultimative WordPress Toolkit

Erhalte KOSTENLOSEN Zugang zu unserem Toolkit - eine Sammlung von WordPress-bezogenen Produkten und Ressourcen, die jeder Profi haben sollte!

Reader Interactions

29 KommentareEine Antwort hinterlassen

  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.

Eine Antwort hinterlassen

Danke, dass du einen Kommentar hinterlassen möchtest. Bitte beachte, dass alle Kommentare nach unseren kommentarpolitik moderiert werden und deine E-Mail-Adresse NICHT veröffentlicht wird. Bitte verwende KEINE Schlüsselwörter im Namensfeld. Lass uns ein persönliches und sinnvolles Gespräch führen.