n00dles101
Administrator
Posts: 971
Joined: Aug 2009
|
QRCodes
A small script that uses Google Chart API to generate QRCodes for your site pages.
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
My Github Repos: Github
Website: DigiMute
|
|
|
|