In addition to this blog I also have a blog about recipes. I decided that I wanted a print icon on the main page for each post so that people can print the recipes. Googling provided various suggestions, none of which worked. However, I eventually cobbled together the following, which seems to work…
<!-- email post links -->
Above that put the following…
[javascript]<script>
function printPost(postUrl)
{
doPrint = true;
var pw = window.open(postUrl);
}
if(opener.doPrint == true)
{
window.print();
window.onfocus = function() { window.close(); }
}
</script>
<a expr:href=’"javascript:printPost(" + """ + data:post.url + """ + ");"’><img src=‘http://siteresources.worldbank.org/images/Print_plain.gif’/></a>[/javascript]
And you’re done!
Credit in various parts goes to…
Consuming Experience
Blogger Plugins
Sharkysoft
Found this useful? Please do let us know by dropping a comment below. If you would like to subscribe please use the subscribe link on the menu at the top right. You can also share this with your friends by using the social links below. Cheers.
Leave a Reply