Some times ago, I shown you how to display your last twitter entry on your WordPress blog. Today, let’s create a button to allow your visitors to send the current post they’re reading to twitter.
Some times ago, I shown you how to display your last twitter entry on your WordPress blog. Today, let’s create a button to allow your visitors to send the current post they’re reading to twitter.
Nothing hard with this recipe: Simply paste the following code on your single.php file, within the loop:
<a href="http://twitter.com/home?status=Currently reading <?php the_permalink(); ?>" title="Click to send this page to Twitter!" target="_blank">Share on Twitter</a>
Your readers are now able to send your post url to twitter! Hope it will bring you some traffic and new readers!
Thanks to BabyGotMac for letting me know about this nice code!
79 Responses
Many thanks Jean:)
You’re welcome
Thanks!
Hi,
I wrote about your website on my blog, http://www.blogatoire.com
i find it very useful for all WP users.
Many thanks
Thanks! Just registered at twitter recently.
Shall try this at my blog.
@Rarst: Hope you’ll enjoy Twitter
You should follow me
@jbj
Done!
Hi, Jean:
Where (within the loop) does the code go? Can you be a tad more specific for the code challenged in the room. (like me) LoL.
Hello Missy,
On single.php, you can paste this code anywhere within the loop. For exemple, you should paste it below the_title();
That’s a great idea to make use of twitter. Thanks for the share. Hopefully this brings in additional targeted traffic as well as a few more followers for twitter.
Wei Liang
Thanks for this… It’s simple, but fun.
Was just thinking there needs to be a plug in for this! I’ll take the code snippet in the meantime . . . thanks so much!!! (PS – love your cat!!)
Thank you for this nifty piece of coding. I included an image to make it a button and it works superbly!
@faryl & @saaleha: Thank you =^.^=
Great, just putting this on my blog now
That’s ideal, I think we’ll be adding that to our blog.
p.s. I love the way your cat avatar looks up at the person you’re talking to!
Wow, that was easy. And I can see how easy it is to add a twitter logo or some other fling to make the button more noticeable.
Thanks!
oh, this is nice… Thanks
think i will be sharing this one round. A really neat piece of code and so simple. Going to use it on my blog.
Thanks dear..this is sweet.helpful
thank you very much.
This is pretty cool. I just used it in one of the designs I’m making. Thanks.
Thanks!!
Thanks for the great tip. I’ll put it on my articles.
Awesome – worked like a charm.
Thank you!
Hello
I not sure if you will be able to help me with this but you seem the person to ask. Is it possible to have a twitter feed as part of a website? If any one has experience with twitter feeds any, info would be gratefully appreciated.
@Anna Green: Sure, you can create a page template with your twitter feed
How do I go about it, is it similar to Wordpress? Is there any software I need to download or do I just apply a news feed? Im really excited by the idea of a daily news feed that is connected to my twitter account. But there doesn’t seem to be a tutorial anywhere!
Great stuff, thanks for this! Great blog btw!
wow… thank u so much. I need it.
I am having interesting issue with this snippet. Trying to include hashtag in tweet and it completely stops working. Tries to open profile with name equal to hashtag instead. I don’t think # has encoded equivalent.
Any ideas?..
add a small icon instead of text and should be better. Cheers!
Nice stuff. Thanks, really need this, especially on start of my new blog.
Just what I need for my new blog. Thanks buddy.
Having a hard time with this. “your single.php file, within the loop:”
I am pretty savvy with code but I have no idea what this refers to.
I saw where you directed somebody to: “On single.php, you can paste this code anywhere within the loop. For exemple, you should paste it below the_title();”
Can you be even more specific? Where am I finding this file at? Sorry if I’m a complete newbie.
@Tony Hurst : Google “WordPress loop” and you’ll find out. Good luck!
Thank you. The confusion is that I’m using Wordpress.com and not Wordpress.org and it appears that I don’t have access to the files through the WP.com interface. The result of your suggestion of googling that made that clear.
This will make Wordpress.com quickly irrelevant for me as it appears that technology and user desire is outpacing the interface.
Thank you so much. -Tony
We have been looking for tools like this to integrate our social media efforts. Thank you.
Trackbacks: