• Resolved radutanasescu

    (@radutanasescu)


    Hello,

    I want to make a Facebook icon at the bottom of every post. I figured the easiest way to do this is to make a link like this:

    <a href="http://www.facebook.com/sharer.php?<Post link>">Facebook</a>

    Is there a php code for the <Post link> link?

    Thanks!

Viewing 11 replies - 1 through 11 (of 11 total)
  • Why not just insert this into your post code where you want it to show ( ie: at the bottom of the post) I currently use this as an author link (that is an image) on the bottom of my post and it works good.

    <a href="facebook.com"><img src="facebook.gif" alt="facebook" border="0" /></a>

    If you do not want to go that route (because you probably thought of it lol) here is a plugin that might work. I have not really gone over the specs myself.

    http://wordpress.org/extend/plugins/add-post-footer/

    ETA: After re-reading your post, it is rather confusing because the title and the actual context are a bit counterproductive, hopefully you are talking about just inserting a link and not a link to said post AKA a postlink? Its a little late for me 😉

    Thread Starter radutanasescu

    (@radutanasescu)

    The problem with that link is that it doesn’t post the article link that the icon is in 🙂 that’s what I’m trying to get.

    I’ll try the plugin, I wanted to avoid plugins because they generally over complicate things.

    Thanks!

    http://wordpress.org/extend/plugins/share-on-facebook/

    I was completely confused lol you want a share on facebook link lol. Plugins are easy as pie and make life so much better lol. IMO 😉

    <Post link>

    If I’m following you…
    <a href="<?php the_permalink() ?>"></a>
    is the post’s link…..

    Thread Starter radutanasescu

    (@radutanasescu)

    I know but they add a lot of php and css for nothing, all I need is a php code that spits out the link of my wordpress post (postlink I guess).

    Something like this:

    <a href="http://www.facebook.com/sharer.php?u=<?php post_link?>" target="_blank" title="Facebook">Facebook</a>

    Only that this <?php post_link?> is just an example to help explain my question, it doesn’t actually work.

    I know where to insert this in my template, I just open index.php and put it where I want it to be.

    I could use a plugin but it would have to be a plugin that lets me use both facebook and twitter and that would allow me to position it where ever I want.

    I have to respect a graphic design for the blog 🙂

    I have to respect a graphic design for the blog :

    Oh lol I am the same way lol Everything has a place haha, my OCD kicks in bad with design lol

    I tend to just use one of the available plugins (sociable for instance)

    swap in my own icons, and the override the plugins css with a few rules of my own in my stylesheet. Maybe it would be easier to just code my template…. but with the plugin once I get things set up, I can add additional services, etc real simply

    This is what you need:

    <a href="http://facebook.com/share.php?u=<?php the_permalink() ?>&t=<?php echo urlencode(the_title('','', false)) ?>">Facebook</a>
    Thread Starter radutanasescu

    (@radutanasescu)

    Thanks a lot!

    Thread Starter radutanasescu

    (@radutanasescu)

    If anyone else needs it, I’ve found the best way to add a facebook icon is this, the link comes from facebook and I’ve inserted the php code necessary for it to post the exact post link:

    <a name="fb_share" style="float:right;" type="button" href="http://www.facebook.com/sharer.php?u=<?php the_permalink() ?>&t=<?php echo urlencode(the_title('','', false)) ?>">Share</a><script src="http://static.ak.fbcdn.net/connect.php/js/FB.Share" type="text/javascript"></script>

    Also, this would be a good way to make a twitter button (the bkg image is added through css, you can get a similar one anywhere:

    .postmetadata a.btn_tweet {
    background:url("images/btn_tweet.png") no-repeat scroll 0 0 transparent;
    display:block;
    font-size:10px;
    height:14px;
    line-height:10px;
    width:40px;
    float:right;
    color:#FFF;
    padding:4px 0 0 23px;
    margin-left:15px;
    font-family:Verdana, Geneva, sans-serif;
    }
    
    <a href="http://twitter.com/?status=<?php echo urlencode(the_title('','', false)) ?>+<?php the_permalink() ?>" title="Trimite articol pe Twitter" rel="nofollow" target="_blank" class="btn_tweet">Tweet</a>

    Ah Thanks for the update 🙂 I will have to bookmark this or save the code 😉 might come in handy

Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘How to get WordPress to write the post link’ is closed to new replies.