0

I'm trying to add socials to my post. I can share the post, but only the post URL. How could I share the post thumbnail, the Title, the excerpt, the author, etc.

This is what i'm trying:

HTML (in single.php):

<div class="share-icons-wrapper">  
    <a href="" onClick="facebookSharer()"><i class="fa fa-facebook share-icon"></i></a>
</div>  

Js

jQuery('.share-icons-wrapper a').click(function(e) {
   e.preventDefault();
});

// Facebook

function facebookSharer(){
window.open( 'https://www.facebook.com/sharer/sharer.php?u='+encodeURIComponent(location.href), 
    'facebookWindow', 
    'width=650,height=350');
    return false;
}   

I don't know wath i'm missing. Thanks.

1

1 Answer 1

-1

OK this is ok, it works great!!!. The problem was that i was testing locally.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.