Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I'm using the QR Code Tag plugin and can't get this to work.

<img src="<?php 
global $qrcodetag; 
echo $qrcodetag->getQrCodeUrl('$_SERVER['PHP_SELF']',100,'UTF-8','L',4,0); 
?>">

I want a qr barcode to get the current url of the category or page or post in my theme.

share|improve this question
    
You try to use this code on wordpress.com? I don’t think that would work. –  toscho May 27 '11 at 1:57
    
Nope, on my own install, and my host gives me access to all php functions. –  sway May 27 '11 at 2:00
    
Okay, I removed the wordpress.com tag. –  toscho May 27 '11 at 2:04
add comment

1 Answer

you can use $_SERVER['REQUEST_URI'] and add you domain before it so:

<img src="<?php 
global $qrcodetag; 
$Path=$_SERVER['REQUEST_URI'];
$URI='http://www.example.com'.$Path;
echo $qrcodetag->getQrCodeUrl($URI,100,'UTF-8','L',4,0); 
?>">

and change http://www.example.com to your domain.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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