Snippet: Generate QR Code for posts and pages

Add following code where you want to show QR image.


<? the_qr_code() ?>

Add following snippet to “functions.php”


function the_qr_code() {
	echo '<img src="'.get_permalink().'" alt="QR:  '.get_the_title().'" />';


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>