Home Forums Fashionic WordPress Theme Facebook Share

This topic contains 7 replies, has 4 voices, and was last updated by  Maria S 3 years, 1 month ago.

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #885

    xurubo93
    Participant

    Hi there,

    the “Facebook Share”-Button in the contentpage and also in the list page is not for sharing. Instead of it it posts a like.

    Is it possible to change this behaviour?

    cheers

    #890

    Johnny
    Participant

    hi, to change like to share please to this:
    open file single.php find this <iframe src="http://www.facebook.com/plugins/like.php?href=<?php the_permalink() ?>&layout=button_count&show_faces=true&width=80&action=like&colorscheme=light" scrolling="no" frameborder="0" allowTransparency="true" style="border:none; overflow:hidden; width:80px; height:30px; float:right;"></iframe>
    replace it with <a href="https://www.facebook.com/sharer/sharer.php?u=<?php the_permalink() ?>" target="_blank"> Share on Facebook</a>
    Best

    #1432

    xurubo93
    Participant

    Hi,

    actually there is a better way to implement the share-button into a single post. I just want to share my way:

    In single.php right after the <body <?php body_class(); ?>>

    include the following code:

    <div id="fb-root"></div>
    <script>(function(d, s, id) {
      var js, fjs = d.getElementsByTagName(s)[0];
      if (d.getElementById(id)) return;
      js = d.createElement(s); js.id = id;
      js.src = "//connect.facebook.net/de_DE/all.js#xfbml=1&appId=344288605698933";
      fjs.parentNode.insertBefore(js, fjs);
    }(document, 'script', 'facebook-jssdk'));</script>

    Then, instead of the iframe you mentioned in your previous post include the following:

    <div class="fb-share-button" data-href="<?php the_permalink() ?>" data-type="button"></div>

    At least this is the recommended method by fb.

    cheers

    #1434

    Johnny
    Participant

    You’re terrific, Thank you.

    #1970

    xrubiras
    Participant

    Hi again,

    I tried your method, but not works.

    Then I tried the “xurubo93” method but:

    – I can’t find “<body <?php body_class(); ?>>” in single.php file.
    – I’m not sure where I should place the code: <div class=”fb-share-button” data-href=”<?php the_permalink() ?>” data-type=”button”></div>

    Can you help me?

    Thank you very much

    #1971

    Johnny
    Participant

    hi, please try this:
    open file single.php and find this or similar:
    <iframe src="http://www.facebook.com/plugins/like.php?href=<?php the_permalink() ?>&layout=button_count&show_faces=true&width=80&action=like&colorscheme=light" scrolling="no" frameborder="0" allowTransparency="true" style="border:none; overflow:hidden; width:85px; height:30px; float:right;"></iframe>
    replace it with:
    <a href="https://www.facebook.com/sharer/sharer.php?u=<?php the_permalink() ?>" target="_blank"><img src="http://i.stack.imgur.com/L8rHf.png" height="16" width="18" alt="" class="sponsor-tag-img"></a>
    reference attached image please.
    Best

    #3953

    Maria S
    Participant

    Hello everyone, I changed the code as you advised – and it works good, but it shares the main page (like http://www.site.com) – but I need it to share the post (like http://www.site.com/post) – is this possible? I know this is expected thing with Ajax -there are solutions in the web, but i can find the working one.

    #3954

    Maria S
    Participant

    I think i found the solution – with social sharing toolkit plugin – it lets to link-share each post. but if there is more nice and easy way – please let me know. Thank you!

Viewing 8 posts - 1 through 8 (of 8 total)

You must be logged in to reply to this topic.