WordPress Themes, Plugins and HTML Templates › Forums › Arcane WordPress Theme › Social Shate Buttons right after Post
- This topic has 9 replies, 2 voices, and was last updated 8 years, 3 months ago by admin.
-
AuthorPosts
-
August 22, 2016 at 10:19 am #696marcwittParticipant
I want to paste static social share buttons right after the post-content, between author box and content. Can you tell me the template file and the exact position where to paste the code?
Thanks a lot!August 22, 2016 at 2:02 pm #1763adminParticipantHi,
Please try Jetpack Sharing module. It will integrate sharing buttons just after the content.
This is the reason, we love JetPack as it provides lot of features under one roof.Best,
August 23, 2016 at 2:02 pm #1764marcwittParticipantThanks for your reply. I want to make my blog faster and one aspect I want to change is the use of static share buttons. I am using jetpack, but don´t want to use the share buttons.
Can you tell me the exact place, in which template to put my snippet fpr the static buttons to appear right aftter the post before the author box?
August 24, 2016 at 5:13 am #1765adminParticipantHi,
You can place your snippet in the following file.
arcane/template-parts/content-single.php
Heads Up:
It is not recommended to modify your theme files directly. You will lose your changes when the theme will be upgraded.
I will recommend to modify the theme via Child Theme. So, you can easily upgrade your theme and your changes will not be lost.Best
August 26, 2016 at 2:36 pm #1766marcwittParticipantAlright, I´m planning to use a use a child theme
Could you tell me the exact line or place, in which to paste my social share button code? I´m only able to put it right under the title, but can´t find the right place to put it right after the content.
August 27, 2016 at 6:57 am #1767adminParticipantGreat to use Child theme
You may find following code of content.[/CODE]
You may place the code below that line.
File: arcnae/template-parts/content-single.php
Approximate Line Number: 26Thanks[CODE][/CODE]
You may place the code below that line.
File: arcnae/template-parts/content-single.php
Approximate Line Number: 26Thanks
August 28, 2016 at 11:28 am #1768marcwittParticipantThanks! But when I do that, only the header loads, not the content anymore,
This is my code:
Jetzt teilen: https://www.facebook.com/sharer/sharer.php?u= echo urlencode(get_permalink($post->ID)); ?>&t=” target=”blank” rel=”nofollow” style=”background:#3D62B3;color:#FFF;padding:1px 5px 1px 5px;font-size:95%”>Facebook http://graph.facebook.com/?ids=‘ . $URL); $json = json_decode($json_string, true); return intval( $json[$URL] );} ?> https://plusone.google.com/_/+1/confirm?hl=de&url= echo urlencode(get_permalink($post->ID)); ?>&title=” target=”blank” rel=”nofollow” style=”background:#D34836;color:#FFF;padding:1px 5px 1px 5px;font-size:95%”>Google+ https://clients6.google.com/rpc“); curl_setopt($curl, CURLOPT_POST, 1); curl_setopt($curl, CURLOPT_POSTFIELDS, ‘[{“method”:”pos.plusones.get”,”id”:”p”,”params”:{“nolog”:true,”id”:”‘ . $url . ‘”,”source”:”widget”,”userId”:”@viewer”,”groupId”:”@self”},”jsonrpc”:”2.0″,”key”:”p”,”apiVersion”:”v1″}]’); curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); curl_setopt($curl, CURLOPT_HTTPHEADER, array(‘Content-type: application/json’)); $curl_results = curl_exec ($curl); curl_close ($curl); $json = json_decode($curl_results, true); return intval( $json[0] );} ?>August 29, 2016 at 6:42 am #1769adminParticipantPlease check your code snippet is working properly. You are using CURL in your code, is your hosting supporting it?
August 29, 2016 at 10:54 am #1770marcwittParticipantWell, the code itself works (s. here: https://bueronerds.de/brnrds/leben/kaffeetrinker-typen-kaffeejunkie-barista/) but only at the beginning of the content. Not at the end…
August 30, 2016 at 4:47 am #1771adminParticipantIf it is working in the beginning than it should work anywhere.
I will again suggest you to use Jetpack social module or use any good social plugin to make your life easy There are lot of options in the WordPress repo. -
AuthorPosts
- You must be logged in to reply to this topic.