Without Template Modification
Three different content selection strategies are availble in the plugin settings.
WP Template
The default strategy, wraps your content in a <div>
with the class pf-content
. This strategy works well for the majority of wordpress sites
The visual styling of some themes may be affected by this setting. Choose another strategy if that happens.
Content Algorithm
Our algorithm automatically detects the content based on various heuristics and factors. This strategy is well suited for text-heavy websites like blogs and recipe sites.
CSS Selectors
If the above two strategies don't work or you want precise control of the content selected by the plugin, choose this option.
With Template Modification
Using specific CSS classes, you can include or exclude content selected by PrintFriendly.
print-only
Only those elements with the print-only
class will be selected when it is used.
<div class="print-only">
<p>This content will be included.</p>
</div>
<div>
<p>This content gets excluded because print-only was used.</p>
</div>
<div class="print-only">
<p>This will be included because it has class="print-only"</p>
</div>
print-yes
Elements with print-yes
class, will be selected in addition to the content automatically selected by PrintFriendly
Tip
print-yes
is best used when PrintFriendly detects most of the content but you want to include some missing elements
print-no
You can apply this class to one or more elements to exclude the elements and all their children.
<p class="print-no">Content not to be included in print/pdf.</p>
pf-title
Add this class to a single element for setting the page title.
<h1 class="pf-title">The Page Title</h1>
pf-author
Add this class to a single element for setting the page author
<p class="pf-author">Author Name</p>
pf-date
Add this class to a single element for setting the publication date.
<div class="pf-date">October 01, 2016</div>
copyright
You can apply this class to one or more elements to include the elements and prevent them from being deleted by the user.
<p class="copyright"><img src="logo.jpg" />Copyright Acme Corp</p>
page-break-before
Adds a page break before any element when printed or converted to PDF
<h2 class="page-break-before">Adds Page Break Before</h2>
page-break-after
Adds a page break after any element when printed or converted to PDF
<section class="page-break-after">Adds break after this element</section>
delete-no
Elements with this class cannot be deleted by the user