Templating

There are four key sections of My Tickets that are templatable: receipts, tickets, the opt-out form for email notifications, and the ticket verification screen used by ticket-takers. They’re all templatable in the standard WordPress way: take a copy of the file from wp-content/plugins/my-tickets/templates/, place it at the root of your theme directory, and edit it until it does what you want.

By default, the templates enqueue their own custom CSS. This CSS is added using the plugin URL, so if you have copied the template into your theme directory, it won’t be automatically accessing the right URL. In the file, find <?php echo plugins_url( 'css/generic.css', __FILE__ ); ?> and <?php echo plugins_url( 'css/ticket.css', __FILE__ ); ?>. Change those to <?php echo plugin_dir_url( 'my-tickets/css/generic.css', __FILE__ ); ?> and <?php echo plugin_dir_url( 'my-tickets/css/generic.css', __FILE__ ); ?>.

You can use that CSS and extend it, or create your own; there are no limitations – the templates include their own CSS, so you simply edit the template to include something different, if that’s what you want.

All My Tickets specific templating functions are in the file my-tickets/mt-templating.php. All functions prefixed with ‘mt_get_’ will return the data for manipulation in PHP; all functions without ‘get_’ will echo the result.