Your cart is currently empty!
-
Customizations
You can fully customize the Post templates and the PDF output of Invoices, Quotes and Accounting posts. File access to your web server is required to upload the HTML templates or to integrate filter hooks in your theme. In addition the generated PDF output may require custom CSS modifications.
Use it at your own risk and be sure to test any changes thoroughly. If in doubt, consult a web developer for help.
Post templates
The following examples are based on the billy-invoice template but feel free to use the same logic for all Billy posts:
- billy-invoice
- billy-quote
- billy-accounting
- billy-contact (PRO only)
- billy-to-do (PRO only)
You should get the idea.
Default templates
[EASY] Override the markup by including a block template HTML file in your theme directory:
/templates/billy-invoice.htmlIt is strongly recommended that you do not start from scratch. Instead, copy the entire HTML source from the default block template (i.e. add a new post and select the “Copy all blocks” option in the three-dot menu), then modify it according to your needs.
Some blocks like
wp:billy-blocks/invoice-date,wp:billy-blocks/invoice-numberorwp:billy-blocks/invoice-tableare mandatory and must be included!
[ADVANCED] Replace the default markup with an array-based block template using filter hooks in a plugin or in your theme:
function my_custom_invoice_template( array $content, array $attrs ) { $header_id = $attrs['ref_header']; $footer_id = $attrs['ref_footer']; return array( // Actions. array( 'billy-blocks/invoice-actions', array( 'align' => 'wide' ), ), // Header (reusable block). array( 'core/block', array( 'ref' => $header_id ), ), // Recipient address field. array( 'core/columns', array( 'align' => 'wide', 'className' => 'details', ), array( array( 'core/column', array( 'className' => 'addressee' ), array( // Static address field. array( 'core/paragraph', array( 'placeholder' => esc_html__( 'Name', 'billy' ) . ' / ' . esc_html__( 'Company', 'billy' ) . "\n" . sprintf( esc_html__( 'Address Field %s', 'billy' ), '1' ) . "\n" . sprintf( esc_html__( 'Address Field %s', 'billy' ), '2' ) . "\n" . esc_html__( 'Country', 'billy' ), ), ), ), ), // Continue here! ) ) ); } add_filter( 'billy_invoice_template', 'my_custom_invoice_template', 10, 2);PDF
If required, the PDF output can be customized independently of the underlying post template. You can even make it post type agnostic.
The following placeholders are pre-populated with the appropriate value:
{DATE},{EMAIL},{SITETITLE},{SITEICON},{CURRENTPAGE},{TOTALPAGES}Main area
[EASY] Override the default markup by including a block template HTML file in your theme directory:
/templates/billy-pdf-content.html(global)/templates/billy-invoice-pdf-content.html(post type agnostic)
[ADVANCED] Replace the default markup using filter hooks in a plugin or in your theme:
function my_custom_pdf_content( string $content, string $post_type ) { // Modify the HTML output here! return $content; } add_filter( 'billy_pdf_content', 'my_custom_pdf_content', 10, 2);Footer area
[EASY] Override the default markup by including a block template HTML file in your theme directory:
/templates/billy-pdf-footer.html(global)/templates/billy-invoice-pdf-footer.html(post type agnostic)
[ADVANCED] Replace the default markup using filter hooks in a plugin or in your theme:
function my_custom_pdf_footer( string $content, string $post_type ) { // Modify the HTML output here! return $content; } add_filter( 'billy_pdf_footer', 'my_custom_pdf_footer', 10, 2 );