Snippet: Generate QR Code for posts and pages

Add following code where you want to show QR image.

Usage

<? the_qr_code() ?>

Add following snippet to “functions.php”

Snippet

function the_qr_code() {
	echo '<img src="http://api.qrserver.com/v1/create-qr-code/?size=100x100&data='.get_permalink().'" alt="QR:  '.get_the_title().'" />';
}

Result

It display the QR code of the post URL.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>