ADVERTISEMENT

How to use QR-CODE for your blog posts ?

For those who don’t know what a QR reader is

A QR Code is a matrix barcode (or two-dimensional code), readable by QR scanners, mobile phones with a camera, and smartphones. The code consists of black modules arranged in a square pattern on white background. The information encoded can be text, URL or other data.

QR codes are one of the active topics in technology field. Almost 32% of smartphone users has already used and 70% are interested to use this. You can add dynamic QR-CODE to each of your posts on blogger site, so that your users can directly view that page from their smartphone.

Before using any code read this :

  • #1 and #2 codes should be placed within wordpress loop to work.
  • #3 and #4 can be used in sidebar, Add a text gadget and use one of these code.
  • Its recomended to use Codes using google api, because it is hosted by google and it insures you that, their will not be any downtime or slow loading.

WordPress Blogs only

1. PHP Code for WordPress blogs using Google Api
<img src="http://chart.apis.google.com/chart?cht=qr&chs=100x100&chl=<?php the_permalink(); ?/>" width="150" height="150" alt="QR code" />

2. PHP Code for WordPress blogs using kaywa Api
<img src="http://qrcode.kaywa.com/img.php?s=5&d=<?php the_permalink(); ?/>" alt="QR code" />

Blogspot and WordPress Blogs

3. JavaScript code for wordpress and blogspot blogs using Google api
<script type="text/javascript">
//<![CDATA[
var url=window.location.href;
document.write("<img src=\"http://chart.apis.google.com/chart?cht=qr&chs=100x100&chl="+encodeURI(url)+"\" alt=\"qrcode\" />");
//]]>
</script>

4. JavaScript Code for WordPress and blogspot blogs using kaywa Api
<script type="text/javascript">
//<![CDATA[
var url=window.location.href;
document.write("<img src=\"http://qrcode.kaywa.com/img.php?s=5&d="+encodeURI(url)+"\" alt=\"qrcode\" />");
//]]>
</script>

Comments

  1. UNKNOWN says:

    Really good post!

  2. damien says:

    I found that the chart api works fine with a relatively simple url but when you try to feed it something like:
    …com/showcaseproductdetail.htm?ID=157729&Used=1&
    it will not encode the whole address resulting in the wrong qr code. Rather than attempt to convert the longer url’s to UTF-8, which presents a risk of not being read properly, I was wondering if you had a relatively simple solution to use the google url shortener within the script (preferrably not the .qr option in the shortener as it defaults to a size too small for print).
    Thanks in advance.

Speak Your Mind

*