If you want to change the word “Tickets” to something else like “Vouchers” in The Events Calendar’s Event Tickets plugin, you can do so by overriding the plugin template and applying some custom CSS.
Step 1: Override the Template File
1. Locate the original template file:
Navigate to:
wp-content/plugins/event-tickets/src/views/v2/tickets/title.php
2. Copy the file:
Duplicate the title.php file from the plugin directory.
3. Paste into your theme:
Place the copied file in your theme at:
wp-content/themes/your-theme/tribe/tickets/v2/tickets/title.php
4. Edit the file:
Open the newly copied title.php in a code editor.
Locate this line (around line 39):
<?php echo esc_html( tribe_get_ticket_label_plural( 'event-tickets' ) ); ?>
Replace it with:
Vouchers
You can change "Vouchers" to any custom label you’d like to display.
Add the code snippet to the functions.php file of your theme, or use your preferred method for integrating snippets into your WordPress site, such as the free Code Snippets plugin.
Step 2: Add Custom CSS
To further adjust the appearance and ensure the label is replaced everywhere visually:
- Go to Appearance > Customize > Additional CSS in your WordPress dashboard.
- The
!importantrule in CSS is used to give a style higher priority, overriding other conflicting styles. It forces the browser to apply the specified style, even if other styles are defined elsewhere. However, it should be used sparingly because excessive use can make the CSS harder to maintain and debug. - In this case,
!importantensures that the font size and content replacement are applied even if other styles are competing. - Add the following CSS:
.tribe-common-h--alt,
.tribe-tickets__tickets-title {
font-size: 0 !important;
}
.tribe-common-h--alt::after,
.tribe-tickets__tickets-title::after {
content: "Vouchers" !important;
font-size: 20px !important;
}
This CSS hides the original label and replaces it visually with “Vouchers.”