I tried to put my public Linkedin profile in the “About” section of my blog. After reading various tutorials, I realized that none were made for statically displaying a specific profile. Here is a simple solution, a small piece of code that you can directly put in your WordPress page or post editor.
1 – Get a Linkedin API key
First, get an Linkedin API key. You can find out how to do that in the chapter 2 of this page.
2 – Retrieve the Data ID
Each Linkedin profile is identified by various ID. The one that interested us now is the Data ID. I wrote a small code to help you getting it. Be sure you are signed in Linkedin and just push the button !
3 – Use this code
If you want to use this code on your WordPress blog, you can directly copy/paste in in the text editor of your post or page. Be sure to edit in “Text” and not in “Visual” (more info). If you are a developer and need it for your website, the proper way should be to but the Linkedin API loader in the header of your page and the rest in the body.
1 2 3 4 5 6 7 8 9 10 11 |
<!-- Load the Linkedin API --> <script type="text/javascript" src="http://platform.linkedin.com/in.js"> api_key: <!-- Replace this comment by your API key --> authorize: true </script> <!-- The profile container --> <div id="profileContainer"> <script type="IN/FullMemberProfile" data-id="RGZXJPi2Rb"></script> <!-- Replace "RGZXJPi2Rb" by the Data ID of the profile you want to display --> </div> |
Result
Conclusion
If the visitor is connected to his/her Linkedin account, this code works perfectly fine. But if the visitor is not logged in, it will display very few information on your the Linkedin profile and show a button to connect in Linkedin. I guess this is a choice of Linkedin, to attract more people.
You can try to see the difference by connecting/disconnecting from your Linkedin profile and refresh this page: when you are connected, the profile is fully displayed, when you are not connected, it will only display the basic information and show you a button to connect.
Personally, I don’t like this feature, so I choose to use a plugin instead of coding myself (WP Linkedin) but the simple code described above may be useful for other uses.
By Alan j Greenspan 18/11/2015 - 08:03
This no longer works.
They don’t have the API key.. they just show a mini snippet and connections with their developer plugins