WordPress.org

Forums

Single.php (14 posts)

  1. fouldsy99
    Member
    Posted 1 year ago #

    On my single.php I have a floating share bar of facebook, twitter etc. The facebook button has like but I would rather the feature be share.

    How can I change this?

    Here's the code I currently use:

    <iframe src="http://www.facebook.com/plugins/like.php?href=<?php echo urlencode(get_permalink($post->ID)); ?>&layout=button_count&show_faces=false&width=100&action=like&colorscheme=light" scrolling="no" frameborder="0" allowTransparency="true" style="border:none; overflow:hidden; width:100px; height:20px;"></iframe>

    Any help appreciated.

  2. Mike Price
    WP Engine Tech Support
    Posted 1 year ago #

    Hey there

    It looks like you need to change the "like.php" part to sharer.php but might also need a few other changes, I am not 100% sure. However, you can take a stab at it by referencing the documentation directly from Facebook:

    https://developers.facebook.com/docs/plugins/share-button/

    Let me know if you have any other questions!

    Mike (Castro Boy)

  3. fouldsy99
    Member
    Posted 1 year ago #

    I have check that page, they gave me the code below. Works just for the website top level domain rather than indivdual posts.

    Just cannot get it work with permanlinks and title on single.php

    <div class="fb-share-button" data-href="http://worldinsport.com" data-type="box_count"></div>

    Regards

  4. fouldsy99
    Member
    Posted 1 year ago #

    Problem solved, for anyone else with similar problem, this is how I solved it:

    If your trying to add the share button from Facebook: https://developers.facebook.com/docs/plugins/share-button/

    Instead of using the HTML5, I tried the XFBML code and it worked perfect.

    Wish I had tried that before, after spending nine hours at it :-(

  5. Mike Price
    WP Engine Tech Support
    Posted 1 year ago #

    So glad to hear you got it up and running finally. I wish I would have thought of that to help you as well. Thanks for posting the answer for others.

    Mike (Castro Boy)

  6. fouldsy99
    Member
    Posted 1 year ago #

    Just doesn't work in Chrome :-(, anyone have a fix?

  7. devonlawrence
    Member
    Posted 1 year ago #

    I have check that page, they gave me the code below. Works just for the website top level domain rather than indivdual posts.

    I am having the smae issue and it is driving me nuts! Can you post the code you found that worked?

  8. fouldsy99
    Member
    Posted 1 year ago #

    I am having the smae issue and it is driving me nuts! Can you post the code you found that worked?

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

    It worked for me.

  9. devonlawrence
    Member
    Posted 1 year ago #

    Thanks. Apparently it is a localhost issue. I found some new information on
    http://wordpress.stackexchange.com/questions/110669/facebook-like-button-disappears-after-changing-the-static-permalink-to-dynamic-o
    I am going to take it live tonight so hopefully that does it!

  10. fouldsy99
    Member
    Posted 1 year ago #

    Did it work for you?

  11. devonlawrence
    Member
    Posted 1 year ago #

    YUP... I spent probably a solid 5 hours researching, writing code and submitting changes before I found that post. Frustrating, but at least we know now!

  12. Pioneer Valley Web Design
    Member
    Posted 1 year ago #

    Each modern search engine includes the ability to use date filters. Use that to filter results by date.

  13. fouldsy99
    Member
    Posted 1 year ago #

    YUP... I spent probably a solid 5 hours researching, writing code and submitting changes before I found that post. Frustrating, but at least we know now!

    Can you post what code you used and how it got it working, for myself and others may run into the same problem?

  14. devonlawrence
    Member
    Posted 1 year ago #

    <div class="fb-like fb" data-href="<?php the_permalink(); ?>" data-layout="button_count" data-show-faces="true" data-send="false"></div>

Topic Closed

This topic has been closed to new replies.

About this Topic