Custom Print Templates for Print-Pro-Matic

Note: This post assumes a basic understanding of WordPress templates and that a child-theme is being used.

To create a custom print template we first need to define a query var to trigger the template.
Add the following to the child-theme’s function.php file:

function printpromatic_query_var( $vars ) {
	$vars[] = 'print_view';
	return $vars;
add_filter( 'query_vars', 'printpromatic_query_var' );

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 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:

function printpromatic_print_template($original_template) {
    if ( get_query_var( 'print_view' ) ) {
		$new_template = locate_template( array( 'print-template.php' ) );
        return $new_template;
	return $original_template;
add_filter( 'template_include', 'printpromatic_print_template' );

Modify the Existing Template

This method involves modifying the current page template to change what it displays based on the presence of the print_view query var.

In the page template being used, we need to check if the query_var is present:

$print_view = get_query_var( 'print_view' );

Now we need to simply wrap the existing template elements in an if statement:

if( empty($print_view) ){
//print only

Archive-Pro-Matic Display Multiple Categories

As of version 1.1.2, multiple categories can be selected using the cat_id attribute. Simply provide a comma separated string of the category ID’s to include. Use a negative ID to omit multiple categories.

For example to include a yearly archive of posts with both the categories of ‘Archive-Pro-Matic’ (ID 55) and ‘collapse-pro-matic’ (ID 43) the shortcode would be:

[archives type="yearly" cat_id="55,43"]

Note: Currently the title of the archive page will display only the first category. A solution to display multiple titles is in the works. Multiple category titles will now display on the archive page.

Countdown Test – Local Computer Time

This is a test of a countdown that will launch at a specific time.
The time should not affected on the visitors local computer time.



Collapse-Pro-Matic Spacing

This is some text

Here is a headline

100-1 First thing
100-2 Second Thing
a. First Sub thing
b. Second sub thing
100-3 Third Thing
100-4 Forth Thing
100-5 Fifth Thing
I am bold.
Some info:
Here is some info that explains more about thing five.
100-6 Sixth Thing
100-7 Seventh Thing

Numbered List Items

<ul class="numbers">
    <li data-pos="2">one</li>
    <li data-pos="2">two
            <li data-pos="2"></li>
            <li data-pos="2">two.two</li>
            <li data-pos="2">two.three</li>
  • one
  • two
    • two.two
    • two.three
  • three
    • three.two
      • – this is a much longer piece of text that will wrap around and should display how the padding and offset of the numbering works with a longer text.
      • three.two.two
  • four


ul.numbers {
    counter-reset: levelone;
    list-style: none;

ul.numbers > li {
    counter-increment: levelone;

ul.numbers > li[data-pos]:before {
    content: attr(data-pos) "." counters(levelone, ".") ". ";

ul.numbers ul {
    counter-reset: leveltwo;
    list-style: none;

ul.numbers ul > li {
    counter-increment: leveltwo;

ul.numbers ul > li[data-pos]:before {
    content: attr(data-pos) "." counters(levelone, ".") "." counters(leveltwo, ".") ". ";

ul.numbers ul ul {
    counter-reset: levelthree;
    list-style: none;

ul.numbers ul ul > li {
    counter-increment: levelthree;

ul.numbers ul ul > li[data-pos]:before {
    content: attr(data-pos) "." counters(levelone, ".") "." counters(leveltwo, ".") "." counters(levelthree, ".") ". ";