How to make a custom LinkedIn share button

前端 未结 10 1550
情书的邮戳
情书的邮戳 2020-12-02 05:47

I need to be able to add sharing functionality to my custom button. I\'m not interested with their generator, as I can\'t change LinkedIn image there. I want to use my own i

相关标签:
10条回答
  • 2020-12-02 06:47

    This works for me:

    https://www.linkedin.com/shareArticle?mini=true&url=articleUrl&title=YourarticleTitle&summary=YourarticleSummary&source=YourarticleSource
    

    You can use this link by replacing it with your content. It works 100%.

    0 讨论(0)
  • 2020-12-02 06:49

    You can customize the standard Linkedin button like this, after the page load:

    $(".IN-widget span:first-of-type").css({
                    'border': '2px solid #DCDCDC',
                    '-webkit-border-radius': '3px',
                    '-moz-border-radius': '3px',
                    'border-radius': '3px'
                    });
    
    0 讨论(0)
  • 2020-12-02 06:51

    July, 2020 - Social Sharing With LinkedIn

    Many of the answers here were valid until recently. For now, the ONLY supported param is url, and the new share link is as follows...

    https://www.linkedin.com/sharing/share-offsite/?url={url}
    

    Source: Official Microsoft.com Linkedin Share Plugin Documentation. All LinkedIn.com links for developer documentation appear to be blank pages now -- perhaps related to the acquisition of LinkedIn by Microsoft.

    Once upon a time, you could use these params: title, summary, source. But if you look closely at all of the documentation, there is actually still a way to still set summary, title, etc.! Put these in the <head> block of the page you want to share...

    • <meta property='og:title' content='Title of the article"/>
    • <meta property='og:image' content='//media.example.com/ 1234567.jpg"/>
    • <meta property='og:description' content='Description that will show in the preview"/>
    • <meta property='og:url' content='//www.example.com/URL of the article" />

    Then LinkedIn will use these! Source: LinkedIn Developer Docs: Making Your Website Shareable on LinkedIn.

    Not sure you did everything right? Take the URL of the page you are sharing (i.e., example.com, not linkedin.com/share?url=example.com), and input that URL into the following: LinkedIn Post Inspector. This will tell you everything about how your URL is being shared!

    Still not sure? Here's an online demo I built with 20+ social share services. Inspect the source code and find out for yourself how exactly the LinkedIn sharing is working.

    I have been maintaining a Github Repo that's been tracking social-share URL formats since 2012, check it out: Github: Social Share URLs.

    Why not join in on all the social share url's?

    0 讨论(0)
  • 2020-12-02 06:52

    You can make your own sharing button using the LinkedIn ShareArticle URL, which can have parameters:

    https://www.linkedin.com/shareArticle?mini=true&url={articleUrl}&title={articleTitle}&summary={articleSummary}&source={articleSource}
    

    You can find the documentation here, just choose "Customized URL" to see the details.

    0 讨论(0)
提交回复
热议问题