The checkbox must have an ID of ppm_odnp (because print-pro-matic optional do not print is a bit long). The value is the optional do not print selector, so .logo is for items with a class of ‘logo’, while #logo is an item with an id of ‘logo’.
Now WordPress will look for something like /?print_view=true at the end of any url.
Next step is to tell print-pro-matic to use the current page with the print_view query variable tacked on the back as the target url. Simply set the url attribute using the %print_view% placeholder as its value:
[print-me id="some_id" url="%print_view%"/]
Finally we need to check for this print_view query var and either a) use a custom print-only template file or b) modify the current page template to switch to a print-only view.
Redirect to Print-Only Template
If a print-only template exists simply redirect to this template file by adding the following code to the child-theme’s function.php file:
Here is an example of using Print-O-Matic to print a WordPress Chart using wp-charts.
As of version 1.6.7c we introduced a new printstyle value ‘external’ for Print-O-Matic. Now it is possible to create an external button to trigger a print in a less-hacky way. Here is an example of this works: To print the following div with an id of ‘print_me_please’:
<div id="print_me_please">This is our target print element</div>
This is our target print element
First we create a kind of roll-your-own print trigger. The details that must be included are:
a unique id
a print-o-matic class such as printomatic or printomatictext
The final thing we need to do is include a hidden print trigger using a print-me shortcode with the same id as our external trigger and the new external printstyle attribute. This shortcode must be placed someplace on the same page, and will load in all the required scripts and settings to make the print trigger work correctly.