My Mom must love me- she actually has printed out one or two of my blog entries. But until tonight, printing one of my blog entries wasn’t exactly easy. I’ve taken care of that now…
I’ve added a new plugin to my WordPress blog- WP-Print by Lester Chan. It seems to be working great: you should see a “print this post” link at the bottom of this posting here on the main page, and a little printer icon near the title when viewing an individual posting. If you click this link the page will be regenerated without the fancy borders and such, ready for printing.
I had to work a bit to get the plugin to work with my site. There were a couple that “broke” the plugin entirely until I corrected them. When I first started up the plugin clicking the link generated a 404 error. That was easy to fix- the readme even told me what to do: re-generate the Permalinks (Options->Permalinks->Update Permalink Structure. Once the 404 error was cleared up, the next problem was that clicking the link generated a blank screen. Looking at my PHP logs revealed this error:
Mar 13 00:21:21 kgadams httpd2: PHP Warning: wp_print(/…/wp-content/wp-print.php): failed to open stream: No such file or directory in /…/wp-content/plugins/print/print.php on line 185
To fix the problem, I changed print.php, line 185 from:
include(ABSPATH . ‘/wp-print.php’);
include(ABSPATH . ‘/wp-content/plugins/wp-print.php’);
Easy to fix…but kind of odd that the original “include” worked for anyone using this plugin- unless I’m misunderstanding the meaning of “ABSPATH”, or its somehow set incorrectly on my WordPress install.