• I previously had a tutorial on a now-closed thread and it doesn’t take into account some of the new changes Facebook and WordPress have made. So here’s an updated one.

    1. Go to Plugins > Editor
    2. Choose “Jetpack by WordPress” from the drop-down menu on the right-hand side of the screen.
    3. Find and click to edit the following file in the list that appears:
      “jetpack/modules/sharedaddy/sharing-sources.php
      (NOTE: You may first have to click on “jetpack/modules/sharedaddy.php” to bring up a new list of files that will include “sharing-sources.php”). If you can’t find it, just put this after your wordpress url: /wp-admin/plugin-editor.php?file=jetpack%2Fmodules%2Fsharedaddy%2Fsharing-sources.php&plugin=jetpack%2Fmodules%2Fsharedaddy.php
    4. Search to locate the following “<div class=”like_button”>” — you should find it a little more than halfway down the page.
    5. Replace the following block of code:
      return '<div class="like_button"><iframe src="'.$url.'" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:'.( $inner_w + 6 ).'px; height:21px;" allowTransparency="true"></iframe></div>';

      with this block of code:

      return '<div class="fb-like" data-href="" data-width="120" data-layout="button_count" data-action="like" data-show-faces="false" data-share="true"></div>';
      (Other ways to display the button can be found here: https://developers.facebook.com/docs/plugins/like-button/)

    You’re also going to need this in your header (after body tag):

    <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/en_US/all.js#xfbml=1&appId=******************";
      fjs.parentNode.insertBefore(js, fjs);
    }(document, 'script', 'facebook-jssdk'));</script>

    PLEASE NOTE: The use of the HTML5 version requires you to have an APP id which would replace the asterisks above. For more about this, visit: https://developers.facebook.com/docs/plugins/like-button/

    You may or may not need to make CSS adjustments after this. Probably not, though.

    And yes, you will have to re-do this every time they update Jetpack.
    (I’m sure there’s some way to avoid having to re-add the code but I’m not skilled enough to know how. Please add instructions if you do.)

    http://wordpress.org/plugins/jetpack/

Viewing 15 replies - 16 through 30 (of 41 total)
  • Thread Starter cozbaldwin

    (@cozbaldwin)

    You might as well use Jeremy’s suggested method if you want a popup window. Facebook native button uses jquery to reveal/hide the share window. http://wordpress.org/support/topic/tutorial-get-facebook-likeshare-buttons-in-jetpack-sharing?replies=16#post-4930145

    @jeremy Herve, @cozbaldwin

    Many thanks

    Jeremy,

    Thanks for the fix to make the Facebook Share button work. I have the link opening a new window but it is a full sized window, not a small one like I have seen on other sites. How do I make the new window a small one?

    Site: poweringimagination.com
    Thanks.

    Plugin Author Jeremy Herve

    (@jeherve)

    Jetpack Mechanic 🚀

    @okskipper Could you try to switch to a different theme for a few minutes? Your theme seems to bundle an old version of jQuery instead of using the version that comes with WordPress. That can cause a few issues with plugins on your site.

    If switching to another theme fixes the problem, you’ll want to look for the function loading jQuery in your theme’s header.php file, or in the functions.php file. Once you find that function, you can remove it and enqueue the proper version of jQuery as explained here:
    http://codex.wordpress.org/Function_Reference/wp_enqueue_script

    If the issue is not related to your theme, please try to disable all your plugins, one at a time, until you find the one that causes the conflict. You can then enqueue jQuery using the method I linked to above.

    If you do not feel comfortable editing PHP files, you can also contact the theme or plugin author and ask them to solve the issue.

    If none of this helps, could you contact us via email so we can take another look at your site?
    Thanks!

    I’m having the same problem with the plug in. I have tried it on different themes and I get the same issue. The website is http://popbuff.com

    Just goto the most recent blog post and you will see the facebook like and share icons.. When you click on the face book like icon, it will show the skinny but tall form that cuts off the majority of the form area so you can’t see what to do.

    This site is using the expound theme.

    Thread Starter cozbaldwin

    (@cozbaldwin)

    So, @davidfreibrun, I guess you’re using the original method at the top of this thread?

    Looks like you’ll need to add a little to your custom CSS. Try this:

    .fb_iframe_widget span {width: 500px !important;}

    Hi @cozbaldwin.

    I add this custom CSS and this is an improvement. Woohoo!

    THe problem now though is the “like” pop up box disturbed the alignment of the other share icons.

    Take a look at this link on my blog
    http://popbuff.com/bangles-sold-show-coach-house/

    Any suggestions?

    Thread Starter cozbaldwin

    (@cozbaldwin)

    Sorry about that. I used to have all this down but I think FB changed their code and I’m not finding the css classes that need to be adjusted. I can try and look at it tomorrow, but no guarantees my friend.

    I appreciate it.

    Thread Starter cozbaldwin

    (@cozbaldwin)

    OK, delete the CSS I gave you earlier (.fb_iframe_widget span)

    And replace it with this:
    .fb_iframe_widget iframe {min-width: 550px;}

    Just remember, although you won’t have to adjust this css file later, you will have to re-add all the other code in the OP each time the Jetpack plugin is updated, if you want to continue using this method.

    That looks much better.

    But now the other social share buttons for twitter and google+ have issue. When you hover over them, they are not linkable unless you move the mouse right to the very top of the icon.

    Take a look on my blog to see what i mean
    at the same link from earlier.

    Thread Starter cozbaldwin

    (@cozbaldwin)

    goddangit!!!

    OK, this should really do it:
    edit what I just gave you. Instead of min-width, make it max-width.

    Thank you! it works great now. Just a minor issue the social icons next to facebook are slightly above.

    Thread Starter cozbaldwin

    (@cozbaldwin)

    You can add this to it: margin-top: -5px;
    So altogether it looks like this:

    .fb_iframe_widget iframe {min-width: 550px; margin-top: -5px;}

    Thanks for helping me on this. The alignment is correct now. I used the following css.

    .fb_iframe_widget iframe {
    max-width: 550px;
    margin-top: -5px;
    }

Viewing 15 replies - 16 through 30 (of 41 total)
  • The topic ‘Tutorial: Get Facebook Like&Share buttons in Jetpack Sharing’ is closed to new replies.