The Events Calendar Add Door Time Feild

Hi,

Here is my website: http://dev.ponyack.com/events/

I am using The Events Calendar ( Not Pro Verison ) and the venue would like an additional field under the Start Time of the show called Door Time.

I need some help creating a simple time picker for the administartor side then some help with the code to show it on the event page.

The easiest way to achieve this would be to install a plugin such as Advanced Custom Fields. This plugin allows you to easily add custom fields to your posts, pages and custom post types. Once the plugin is installed, you can add a field for Door Time and choose the ‘Time Picker’ field type. This will allow you to add a time picker to the admin side of your website.

To display the field on the front end, you can add this code to your theme’s functions.php file:

add_action('tribe_events_single_event_after_the_content', 'my_custom_field_content');

function my_custom_field_content() {

$door_time = get_post_meta(get_the_ID(), 'door_time', true);

if(!empty($door_time)) {

echo '<p>Door Time: ' . $door_time . '</p>';

}

}

This code will check if the Door Time field has been filled out, and if so, it will display it on the front end. You can adjust the format of the time if needed.

Sponsor our Newsletter | Privacy Policy | Terms of Service