Continuing the theme of selectively showing widgets and stuff, I added a retweet button on single posts only. The button appears just below the post title.
If you have one or several full posts on your homepage then you want a retweet icon for each one! But if you use the readmore excepts then you don’t want 7 or 8 buttons on the homepage. Besides, who would tweet before reading the entire post?
It’s super easy to do, especially if you use this excellent post at BloggerPlugins.org. I don’t believe in reinventing the wheel (or copying it either). Aneesh gives you code for positioning the button on the top left or right using a full icon like below or a compacted one (takes up one thin line).I opted for the left side since many of my images are aligned on the right.
If you want the button on your homepage then just follow Aneesh’s tutorial and you’re done! Otherwise, go there to select your code, add your Twitter account’s url, post the code in your template. Don’t forget to leave a comment on his post! Preview your template and you’ll see the icon on your excerpts — but not for long! While the template is open, follow the steps below. Basically you’re adding conditional tags that limit the button to single pages only:
Step1: Place the code in green just before the div line in Aneesh’s code:
<b:if cond=’data:blog.pageType == “item”‘>
Step 2: Place the code in green just after the end div line:
Preview (now you will NOT see the buttons on the homepage), Save the template and Open a single page. Finished!