Shortcodes can do quite a lot in your website’s content. Here’s all the shortcodes added by Print My Blog.
Print Buttons
These shortcodes are for adding PMB’s print buttons to your posts and pages.
Shortcode | Description | Example |
---|---|---|
[pmb_print_buttons] | Add PMB’s Print Buttons to a post (using settings set on PMB’s Settings page). See this FAQ. | Somewhere inside your theme’s PHP file, add <?php echo do_shortcode('[pmb_print_buttons]');?> . Alternatively, somewhere in a post or page, add [pmb_print_buttons] . |
[pmb_print_page_url] | Just gets the URL of the print page for more advanced integrations. You can supply it with the ID of a different post, and the format (defaults to “print”, but also accepts “pdf” or “ebook”), and whether to add_protocol (ie, by default, the URL begins with “http://” or “https://”, but setting this to 0 will prevent that, in case it was already added). | [pmb_print_page_url] or [pmb_print_page_url format=pdf add_protocol=0] will produce the URL of the print page for a PDF but not add the “https://” onto the start of the URL.0]] |
Showing/Hiding Content in Print
Add to posts, pages, and custom post type to customize how the content will appear differently depending on whether it’s viewed on your website or in print/pdf/ebook.
Shortcode | Description | Example |
---|---|---|
[pmb_web_only_text] … [/pmb_web_only_text] | The words between the opening and closing shortcode will only appear on the website, not in PMB projects. Best used on individual words within a paragraph, not entire blocks of text or other content. | I hope you enjoyed this[pmb_web_only_text] post[/pmb_web_only_text]! |
[pmb_web_only_blocks] … [/pmb_web_only_blocks] | The blocks between the opening and closing shortcode will only appear on the website, not in PMB projects. Best used on entire blocks of text and other content, not individual words. | [pmb_web_only_blocks] Welcome back readers! Today I have a special post for you on frogs! …video of a frog and other blocks… [/pmb_web_only_blocks] Frogs are amphibians, usually green… |
[pmb_print_only_text] … [/pmb_print_only_text] | The words between the opening and closing shortcode will only appear on the PMB projects, not on your website. Best used on individual words within a paragraph, not entire blocks of text or other content. | I hope you enjoyed this [pmb_print_only_text] chapter[/pmb_print_only_text]! |
[pmb_print_only_blocks] … [/pmb_print_only_blocks] | The blocks between the opening and closing shortcode will only appear in PMB projects, not on your website. Best used on entire blocks of text and other content, not individual words. | [pmb_print_only_blocks] For more information about frogs, please see my other book. …picture of other book about frogs and other blocks… [/pmb_print_only_blocks] Now we move onto salamanders… |
Dynamic Content
Use in your PMB Pro projects for dynamic content.
Shortcode | Description | Example |
---|---|---|
[pmb_project_title] | Inserts the current project’s title. If the project has a metadatum called “Title” it is used instead. Especially useful for custom title pages, or referring to the project itself elsewhere in the project. | Praise for [pmb_project_title] |
[pmb_toc] | Inserts the project’s table of contents. The table of contents is generated dynamically, and styled by your design. Useful in case you want to customize the table of contents page. | Topics covered: [pmb_toc] Have fun! |
[pmb_title_page] | Insert’s the design’s entire dynamic title page. Each design generates the title page differently, usually using project metadata. If you want to customize the title page, you should probably instead use <-- pmb there is no project title because this post is not being viewed as part of a project. You should probably not show this post to site visitors by making it private.--> | [pmb_title_page] |
[pmb_byline] | Gets the project’s metadatum “Byline” which normally contains the project’s author(s). | A Tale of Two Thumbs [pmb_byline] |
[pmb_footnote] … [/pmb_footnote] | Places the content between the opening and closing shortcode in a footnote when a project is printed. Useful for including content besides URLs in footnotes. | Print My Blog makes WordPress a replacement for Microsoft Word![pmb_footnote]Note: Print My Blog is not part of the WordPress Foundation. It is a plugin that extends WordPress[/pmb_footnote] |