I have a handcoded site with a few hundred articles. My current theme follows a blue background. Of course the images are therefore, with a blue background. For future support of printable versions, I have (from first day) kept two versions of the images with the latter one having a white background. These ones has ‘_print’ before their extensions.
Of course, the best way to create a printable version is to use a different CSS and hide headers and sidebars by ‘display:none’ in respective CSS.
Is there any way I can use PHP to automatically add ‘_print’ before ‘.jpg’ in printable versions? Or is there is any other way altogether?
You could probably do this either with PHP or with Javascript.
in PHP you could just pass a parameter like ?print=true and then write a little helper function to get the appropriate image url.
Disclaimer – not a PHP dev.