Want to show the organizer of each event in the event listing generated by The Events Calendar Shortcode & Block? You can do that with a small amount of customization!

Getting Started

To begin, make sure you have Events Calendar Pro and The Events Calendar Shortcode & Block plugin installed and activated on your WordPress site. If you haven’t already, create an event and add an additional field, let’s call it “My Additional Field.”

Creating a Custom Template

You can create a custom template for any of the designs. For example, for the Default design, you can copy the-events-calendar-shortcode-pro/templates/v2/default.php to wp-content/themes/your-theme/tecshortcode/default.php so we can edit this file with the data from our Additional Field.

Copy the template file default.php from the-events-calendar-shortcode-pro/templates/v2/ to your theme directory. Place it in the following path: wp-content/themes/your-theme/tecshortcode/default.php

Outputting the Organizer

Open default.php in your preferred code editor and locate the section where you want to display the additional field data.

Add the following code snippet to display the organizer name:


<?php if ( tribe_has_organizer() ): ?>
Organizer: <?php echo tribe_get_organizer(); ?>
<?php endif; ?>

Verify the Output

Go to a page where the Events Calendar Shortcode & Block is used with the “Default” design, such as a page with the following shortcode:


[ecs-list-events]

Alternatively you can add a new “Event Calendar Block” and choose the Default design:

You should see the organizer name displayed for each event.

Conculsion

By following these steps, you can easily output your organizer name stored in The Events Calendar events using The Events Calendar Shortcode & Block.

Published by Brian Hogg