I am having vendor address field for each post using custom field plugin. In single post page.I want to generate bar code.When its scanned by mobile phone.It should display the address of the vendor in text format.

Is there any existing plugin.Or any gold suggestions are appreciated.

Thanks in advance !


No need for a plugin if you use the Google Chart tool api its very simple, i have a function that i wrote a while back:

* function to get QR code Image from google chart API
* @Params:
* $content - (string) the content to store inside the QR code (eg: url,address,string..)
* $size - (string) the size of the QR code image , must be in heightxwidth format(eg: 150x150 , 320x320)
* $ImgTag - (bool) if set to true the function will echo out the full img tag of QR code image , 
*           if false then the function will return the image src (default = true)

function get_QR_code($content = null,$size = null,$ImgTag = true){
    if ($size == null){
        $size = '150x150';
    if ($ImgTag){
        echo '<img src="http://chart.apis.google.com/chart?cht=qr&chs='.$size.'&choe=UTF-8&chld=H&chl='.$content .'">';
        return 'http://chart.apis.google.com/chart?cht=qr&chs='.$size.'&choe=UTF-8&chld=H&chl='.$content;


<?php get_QR_code('Hello form Google API'); ?>

which will give you this:

enter image description here

So once you have this function in your theme's functions.php file you can call it in your template and pass the custom field value as the content:

$qr_content = get_post_meta($post->ID,'vendor_address_field_name',true);
  • this is really cool.How can i test it . is it working correctly? Give me suggestions please.
    – Gowri
    Jun 27 '11 at 12:28
  • How can you test what? , i know its working, i've used it a lot before.
    – Bainternet
    Jun 27 '11 at 12:38


Seems like a good one. It just uses a shortcode for you to place the bar code wherever you like, the default makes a code for the post url, but you can specify a specific url to your vendor or whatever in the shortcode it looks like.

I haven't tested this, but it seems to be working well for others. I'm not sure if it can be configured to grab the address from the custom field..... but it seems simle enough to add the address for yourself if that is acceptable

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.