A voucher page prints the voucher once for each copy set on it, each copy on its own page. The plugin does this itself, so no theme template is needed.
Voucher Copies block
lh-voucher-post-type/voucher-copies is a dynamic block that renders the voucher’s featured image (if it has one) and content once per copy, at least once, with no title, then a single Edit link for users who can edit the voucher. Each copy is an article.lh_vpt-voucher-copy. Its content is wrapped in entry-content is-layout-flow, as core’s Post Content block wraps post content, so left- and right-aligned blocks float as they do on a normal post. Each copy runs the content filters afresh, so a Voucher Number block or [lh_voucher_number] shortcode in the content counts up from copy to copy. The block renders nothing outside a voucher, and never inside its own output.
Single voucher template
The plugin registers a single-lh_vpt_post_type block template (WordPress 6.7+, register_block_template): the theme’s header template part, a constrained main.lh_vpt-voucher group holding the Voucher Copies block, and the theme’s footer part. A theme’s own single-voucher template, or a user-edited copy in the Site Editor, takes precedence over it.
Print styles
The plugin ships two print rules, as inline CSS loaded only on pages that show the block: each copy after the first starts on a new page, and the template’s main group has no top padding, so the first copy starts as high on its page as the later ones. Copies are not kept from splitting across pages: a copy taller than a page would otherwise be pushed onto the next one, leaving a blank page behind it. Everything else about printing is the theme’s: LH 2015’s print stylesheet leaves out the site header and footer, and the Edit link carries no-print. Page margins are the browser’s. A voucher meant to fill one printed page has to fit within it.
Filters
lh_vpt_return_voucher_copies: the number of copies to print for a voucher (always at least 1). Receives the count and the voucher ID.lh_vpt_return_print_css: the inline print CSS.lh_vpt_return_template_content: the block markup of the single voucher template.
