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 have a Wordpress blog at http://rlc.vlinder.ca on which I show a QR code containing the URL of the current page. I'm using the "QR Code Widget" for that and it works fine, mostly, except that it doesn't show up if the page is printed.

I have another QR code plug-in installed on the blog, "WP Page QR", which does show up in print (with a slight change to the CSS), but doesn't look nice at all in the browser.

I've tried activating them both, but they both use the same PHP class library to generate the QR image, so activating the second simply crashes (which is caught by WordPress, which promptly deactivates the plug-in again).

What I'd like is to show the QR code from the "QR Code Widget" in the browser, and show the one from "WP Page QR" in print, or do something similar to put the QR code on the printed page where it is most useful) -- not necessarily using the two plug-ins.

Is there a plug-in that would already allow me to show the QR code in the widget area (on the right) in the browser, and print it somewhere on paper when printing? Is there a plug-in that would allow me to "simply" format the printed version?

I am currently planning to edit the "WP QR Code" plug-in to allow me to activate it while "QR Code" is also active, but I'd like to avoid forking off a plug-in if I can..

share|improve this question
    
It's a Question about CSS. See @Geert's answer below. –  Webord Feb 23 '12 at 19:49
    
@Webord actually, I think it's a wee bit more complicated than just adding a few lines of CSS, but Otto's comment and the reply together should be enough to patch something up in a child theme. I guess I have to look into this a bit closer... –  Ronald Feb 24 '12 at 4:08

1 Answer 1

I think you'll get a long way just by applying print styles in your CSS file.

@media screen {
  #widget-for-print { display:none; }
}
@media print {
  #widget-for-screen { display:none; }
}

http://reference.sitepoint.com/css/at-media

share|improve this answer
    
Well, the whole widget area (in which the on-screen widget is shown) is hidden in print and without modification, I can't run both widgets at the same time, so to do this, I still have to modify one of the widgets to have the two run simultaneously. Then I'll be able to use the @media rule –  Ronald May 8 '11 at 16:03
    
You don't really need a widget to display a QR code link. I use the Google Chart API to do it with code like this in my template: echo '<img style="float:right" src="http://chart.apis.google.com/chart?cht=qr&chs=80x80&choe=UTF-8&chld=L|0&chl‌​='.wp_get_shortlink().'">'; –  Otto Jun 7 '11 at 21:34

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.