Facebook share and like – where can i put the code?

Posted in: Newspaper
Post count: 5

(This is a picture of my old theme)
FB

On my old theme i did just put this code in single.php, but on Newspaper that doesn’t seem to work(?)


<br>
<iframe src="//www.facebook.com/plugins/like.php?href=https%3A%2F%2Fwww.facebook.com%2&width&layout=standard&action=like&show_faces=false&share=false&height=35&appId=796648480393803" scrolling="no" frameborder="0" style="border:none; overflow:hidden; height:35px;" allowTransparency="true"></iframe>

<br>
<div style="text-align: center; border:0px !important;">
<script type="text/javascript">// <![CDATA[
function fbs_click() {u=location.href;t=document.title;window.open('http://www.facebook.com/sharer.php?u='+encodeURIComponent(u)+'&t='+encodeURIComponent(t),'sharer','toolbar=0,status=0,width=626,height=436');return false;}
// ]]></script>" target="_blank">
</div>

I want the like and share button at the end of the article, but i need to know where i can place the code.

Does anyone know?

Post count: 260

in yout theme enter in loop-single.php

The line 67 its social sharing, move it to line 59.

In your wordpress dashboard go to theme panel + post settings + sharing + activate article sharing

Regards

Post count: 5

Where can i place this code?

<br>
<iframe src="//www.facebook.com/plugins/like.php?href=https%3A%2F%2Fwww.facebook.com%2&width&layout=standard&action=like&show_faces=false&share=false&height=35&appId=796648480393803" scrolling="no" frameborder="0" style="border:none; overflow:hidden; height:35px;" allowTransparency="true"></iframe>

<br>
<div style="text-align: center; border:0px !important;">
<script type="text/javascript">// <![CDATA[
function fbs_click() {u=location.href;t=document.title;window.open('http://www.facebook.com/sharer.php?u='+encodeURIComponent(u)+'&t='+encodeURIComponent(t),'sharer','toolbar=0,status=0,width=626,height=436');return false;}
// ]]></script>" target="_blank">
</div>

Post count: 6600

Hi,

Try to edit the loop-single.php file and add it there: http://screencast.com/t/90LtF1UL9Rlt

Thanks

Post count: 5

It don’t work, nothing shows up..

Post count: 6600

Hi,

Add it like this: http://screencast.com/t/LcDjuecYcLDz and check the default post template: http://screencast.com/t/BxQCU18CrJxg

Thanks

Post count: 5

Okay! Now i understand…

loop-single.php is the main template and loop-single-1.php, loop-single-2.php etc.. is the other templates.

I did not use the main template, thats why nothing showed up..

______

But i got one problem, the facebook share button is not centered, do you know why? The code says “centered”….

wt

Here is the code.

<div style="text-align: center; border:0px !important;">
<script type="text/javascript">// <![CDATA[
function fbs_click() {u=location.href;t=document.title;window.open('http://www.facebook.com/sharer.php?u='+encodeURIComponent(u)+'&t='+encodeURIComponent(t),'sharer','toolbar=0,status=0,width=626,height=436');return false;}
// ]]></script>" target="_blank">
</div>

Post count: 6600

Hi,

Glad you figured it out. It could be because the style it’s overwritten. Please provide your site’s URL, I need to inspect this in order to give you a better answer.

Thanks

Post count: 5

This is the URL

url

Post count: 1291

Hi,

Try the following css: – http://screencast.com/t/24ZRspqeZ

a[title="Klikk her for og del dette på Facebook"] img {
margin: 0px auto;
}

Thank you, Emil G.

Viewing 10 posts - 1 through 10 (of 10 total)
The forum ‘Newspaper’ is closed to new topics and replies.