Tickera’s event pages already offer several useful fields: location, event logo, sponsor logo, and the main content area where you can write anything you want. But sometimes you need one more dedicated field for extra information that doesn’t fit anywhere else. Maybe you want to store a Facebook page link, a phone number, a streaming link, or any other kind of custom event field that you might want to print on the event page or inside the ticket using a shortcode.
You can add this kind of custom field with just a small amount of code or by installing a ready-made add-on.
The first step is to register a new field inside the event editor. You can place the following snippet in your theme’s functions.php, use a code-snippet plugin (such as the one found here ) or turn it into a small custom add-on:
add_filter( 'tc_event_fields', 'tc_modify_event_fields', 10, 1 );
function tc_modify_event_fields($fields) {
$fields[] = array(
'field_name' => 'event_facebook',
'field_title' => __('Facebook Page', 'tc'),
'field_type' => 'text',
'field_description' => __('Add facebook page for the event', 'tc'),
'table_visibility' => true, 'post_field_type' => 'post_meta'
);
return $fields;
}After adding this, open any event in Tickera and scroll down. You’ll see a new field labeled Facebook Page. You can fill it with whatever information your custom use-case requires.
If you plan to use this technique for more than one field, here’s what you may want to adjust:
The rest of the values should stay as they are.
If you want to see a more advanced real-world example of this same logic in action, take a look at the solution for displaying event organizer details, which uses a very similar approach but wraps everything into a ready-to-install add-on.
Once the field exists, you can display its value anywhere on your site by adding a simple shortcode. Place this snippet directly below the previous one:
add_shortcode( 'tc_event_facebook', 'tc_event_facebook' );
function tc_event_facebook($atts) {
extract(shortcode_atts(array(
'id' => ''
), $atts));
return get_post_meta($id, 'event_facebook', true);
}Once done, you will be able to use shortcode [tc_event_facebook id="123"] where 123 shout be changed with the ID of your event (you can find your event ID by navigating to the Events area of Tickera where all the existing events are listed). Of course, quotation marks around the ID should remain.
Aaaaaand that's basically it 🙂
If you prefer not to deal with code, you can skip all of the manual steps and install the version that already contains everything as a plugin. You can still open the file and customize the field name, label, and description later if needed.
Install it like any other WordPress plugin. It works with standalone Tickera as well as Tickera running alongside WooCommerce via Bridge for WooCommerce.
If you're not comfortable editing code or modifying the add-on, feel free to open a support ticket at support.tickera.com. Tell us what kind of custom event field you need, and we’ll help you set it up.