Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5
  1. #1
    New to the CF scene
    Join Date
    Dec 2012
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question Facebook Like Button

    Hi! I need some help with implementing a facebook social plugin (the like button) on my site.

    My site has a a home page where the latest blog posts are listed and under each post has a like button under it, which works fine. MY problem is that when a user clicks 'like' they are actually liking the current page which is the home page and not the actual post's single page.

    I know that this has something to do with the permalink but I don't know how to make it so that the user is liking the post's single page from the homepage!

    Any help is much, MUCH appreciated!

  • #2
    Regular Coder
    Join Date
    Jul 2012
    Location
    London
    Posts
    473
    Thanks
    4
    Thanked 86 Times in 86 Posts
    Are you using WordPress; what software are you using or is it self coded?

  • #3
    New to the CF scene
    Join Date
    Dec 2012
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I'm using Thesis 2 on Wordpress. I got the functionality of what I want but now I just need to format it. You can see what it looks like here: frun7.com.

    Instead of them appearing vertically stacked if like them to appear beside each other horizontally.

    Here is the code that I have in my functions.pho file for the like button and a tweet button:

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

    <?php }
    }
    add_action('thesis_hook_after_post','fb_like');





    function twitter_button() { ?>
    <div class="tweetbutton">
    <a href="http://twitter.com/share" class="twitter-share-button" data-count="right" data-text="<?php the_title(); ?>" data-url="<?php the_permalink(); ?>" data-via="diythemes">Tweet</a>
    <script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script>
    </div>
    <?php }

    add_action('thesis_hook_after_post', 'twitter_button');

  • #4
    Regular Coder
    Join Date
    Jul 2012
    Location
    London
    Posts
    473
    Thanks
    4
    Thanked 86 Times in 86 Posts
    Okay.

    You have the following iframe.

    Change the style to:

    Code:
    <iframe src=" style="border:none; overflow:hidden; width: 90px; float: left;height: 26px;"></iframe>

  • #5
    New to the CF scene
    Join Date
    Dec 2012
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts
    thanks, it looks great!


  •  

    Tags for this Thread

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •