Hi Guys, would it be possible to add a social network (Linkedin) to the Share post widget on individual blog posts.
Thanks
Z
This topic has 13 replies, 4 voices, and was last updated 10 years, 3 months ago ago by Eva Kemp
Hi Guys, would it be possible to add a social network (Linkedin) to the Share post widget on individual blog posts.
Thanks
Z
Hello,
You need edit the file wp-content/themes/royal/framework/shortcodes.php (find section “Share this product” in line 1918) and add this code after 1947th line
if($linkedin == 1) {
$html .= '
<li>
<a href="http://link_to_your_linkedin_account" class="'.$tooltip_class.'" title="'.__('LinkedIn', ET_DOMAIN).'" target="_blank">
<i class="ico-linkedin"></i>
<svg width="38" height="38" xmlns="http://www.w3.org/2000/svg" class="circle">
<circle cx="19" cy="19" r="18" fill="rgba(255,255,255,0)" stroke="#000000"></circle>
</svg>
</a>
</li>
';
}
and add this code after the line 1931:
'linkedin' => 1,
Regards,
Eva Kemp.
Hi There, I have tried this and get the button in no problem. However when i click to share post it redirects to Linkedin and gives me errors. It doesnt seem to be generating the post title/image and url
Thanks
Hello,
I’ve edited link in previously provided code in wp-content/themes/royal/framework/shortcodes.php to the following:
<a href="https://www.linkedin.com/shareArticle?mini=true&url='.$permalink.'&images='.$image.'" class="'.$tooltip_class.'" title="'.__('Linkedin', ET_DOMAIN).'" target="_blank">
Please check Linkedin share button now.
Best regards,
Jack Richardson.
Hi, would it be possible to get a an excerpt and image to display on share post aswell.
Thanks
Hi, May I please have some feedback on this ticket.
Thank You
Hello,
Have you removed LinkedIn icon?
May we place it back to check the issue?
Regards,
Eva Kemp.
Hi Eva, yes please. Apologies. Updated the theme to new version and lost that mod. Please do go ahead.
Thank You
Regards,
Z
Hello
Please read here how to create the child theme:
https://codex.wordpress.org/Child_Themes
Let us know if the child theme is already created and we will add linkedin code to the fuctions.php.
Regards,
Brian Johnson
Hi yes, i have been using a child theme.
Thanks
Hello,
I’ve readded the code.
The reason you don’t see article content when sharing a post is the authorization you’re using for your site. Try to disable it and check sharing links after that.
Regards,
Eva Kemp.
Hi Eva, thank you for the assistance. By far the best support from all Theme companies.
Regards
Z
Hello,
Thank you for your feedback!
Have a nice day.
Regards,
Eva Kemp.
The issue related to '‘Share Post on Blog’' has been successfully resolved, and the topic is now closed for further responses