WordPress.org

Ready to get started?Download WordPress

Forums

Custom share button for LinkedIn (4 posts)

  1. jonjensen
    Member
    Posted 4 years ago #

    I have a box with buttons at the footer of all my posts to share (http://jonjensen.com/blog/?p=1487 for example). All the buttons work, but I can't figure how to automatically generate the URL, blog title, and a first paragraph in the PHP.

    LinkedIn says this is possible: http://www.linkedin.com/static?key=developers_widget_shareonlinkedin

    Anyone know what code I can put in to auto-generate the meta data?

    Seriously stumped.

  2. codybuell
    Member
    Posted 4 years ago #

    Yep, here is one possibility for your link:

    <a href="http://www.linkedin.com/shareArticle?mini=true&url=<?php the_permalink() ?>&title=<?php the_title(); ?>&summary=&source=<?php bloginfo('name'); ?>" target="_new">

  3. Frank.Prendergast
    Member
    Posted 4 years ago #

    Just in case anyone is looking for more info on how to create a custom LinkedIn button in a WordPress template I put together notes on my approach here: http://frankprendergast.ie/blog/1027/linkedin-share-button-wordpres/

    I hope to have a plugin to handle it soon, but in the meantime, I hope this helps.

  4. Frank.Prendergast
    Member
    Posted 4 years ago #

Topic Closed

This topic has been closed to new replies.

About this Topic