2012-06-26, 01:51:17
A small script that uses Google Chart API to generate QRCodes for your site pages.
Copy the following script to your themes 'functions.php'
to use just call it like so in your theme:
See it in action here: http://www.digimute.com
Copy the following script to your themes 'functions.php'
Code:
function google_qr($url,$size ='150',$EC_level='L',$margin='0') {
$url = urlencode($url);
echo '<img src="https://chart.googleapis.com/chart?chs='.$size.'x'.$size.'&cht=qr&chld='.$EC_level.'|'.$margin.'&chl='.$url.'" alt="QR code" width="'.$size.'" height="'.$size.'"/>';
}
to use just call it like so in your theme:
Code:
google_qr(url);
// other options are:
// google_qr(url, size, ECLevel, margin);
// url is the URL for your QRCode
// size, size in pixels for image
// ECLevel, Error Correction Level
// margin, margin around image
See it in action here: http://www.digimute.com