> ## Knowledge Base Index
> Fetch the complete knowledge base index at: https://support.webnus.net/sitemap.xml
> Use this file to discover available pages before exploring further.
> Pure-Markdown content can be obtained by appending a '.md' suffix to the content URLs listed in the sitemap (without the trailing slash).

# Overriding Single Event Page

In this article, we will explain the process of overriding single event page.

MEC is created by developers for developers! And it’s highly developer-friendly so you can simply override [MEC](https://webnus.net/) templates in your [theme](https://webnus.net/deep-premium-wordpress-theme/) and make it compatible with your theme style or use MEC filters/actions to customize it.

## Overriding Single Event Page

With the Overriding Modern Events Calendar [Single Event Page](https://webnus.net/dox/modern-events-calendar/single-event-settings/) feature, as a developer, you can easily adjust themes and customize your website in the best possible way.

MEC has a number of template files in /path/to/modern-events-calendar/templates/, you can simply override them in your theme or child theme.

For instance, place them on the /path/to/theme/single-mec-events.php or /path/to/child-theme/single-mec-events.php.

**Note:** If you use the lite version of MEC insert **\-lite** after “modern-events-calendar”.Let’s learn how to build an exclusive Single Event Page for our events.

## Creating a PHP file in the theme folder

First, create a PHP file in the root folder of your theme named single-mec-events.php.

Then, in coding, call the main WordPress functions of get\_header and get\_footer.

For example:

get\_header();

get\_footer();

Now, you can place all your desired content between those 2 functions.

## Supported PHP functions

Before getting any necessary fields for MEC, it is worth mentioning that the MEC plugin supports the main functions like getting titles, content, categories, tags, and featured images, however, loading other items needs to be done using the defined functions in

| #   | Name | Code |
| --- | --- | --- |
| 01  | Title | get\_the\_title(); / the\_title(); |
| 02  | Content | get\_the\_content(); / the\_content(); |
| 03  | Thumbnail | the\_post\_thumbnail(); / the\_post\_thumbnail(‘full’); |
| 04  | Tag | get\_the\_tags(); |
| 05  | Label | get\_terms( array(‘taxonomy’ => ‘mec\_label’,’hide\_empty’ => false,)); |
| 06  | Category | get\_terms(array(‘taxonomy’ => ‘mec\_category’,’hide\_empty’ => false,)); |
| 07  | Event Color | get\_post\_meta( get\_the\_ID(), ‘mec\_color’, true ); |
| 08  | Start Date | get\_post\_meta( get\_the\_ID(), ‘mec\_start\_date’, true ); |
| 09  | Start Hours | get\_post\_meta( get\_the\_ID(), ‘mec\_start\_time\_hour’, true); |
| 10  | Start Minute | get\_post\_meta( get\_the\_ID(), ‘mec\_start\_time\_minutes’, true); |
| 11  | Start AM/PM | get\_post\_meta( get\_the\_ID(), ‘mec\_start\_time\_ampm’, true); |
| 12  | End Date | get\_post\_meta( get\_the\_ID(), ‘mec\_end\_date’, true ); |
| 13  | End Hours | get\_post\_meta( get\_the\_ID(), ‘mec\_end\_time\_hour’, true); |
| 14  | End Minute | get\_post\_meta( get\_the\_ID(), ‘mec\_end\_time\_minutes’, true); |
| 15  | End AM/PM | get\_post\_meta( get\_the\_ID(), ‘mec\_end\_time\_ampm’, true); |
| 16  | MEC Comment | get\_post\_meta( get\_the\_ID(), ‘mec\_comment’, true ); |
| 17  | Read More | get\_post\_meta( get\_the\_ID(), ‘mec\_read\_more’, true); |
| 18  | More Info | get\_post\_meta( get\_the\_ID(), ‘mec\_more\_info’, true); |
| 19  | Cost | get\_post\_meta( get\_the\_ID(), ‘mec\_cost’, true ); |
| 20  | Event Excerpt | get\_the\_excerpt(); |

## Modern Events Calendar Widgets

If you need to load the MEC’s widgets, please proceed as follows:  
You should first add the following code in the PHP file “single-mec-events.php” you placed in the theme’s root directory.

$single = new MEC\_skin\_single();
$single\_event\_main = $single->get\_event\_mec(get\_the\_ID());
$single\_event\_obj = $single\_event\_main\[0\];

Then call the widgets:

// attendees widget
$single->display\_attendees\_widget($single\_event\_obj);

// Booking Module
$single->display\_booking\_widget($single\_event\_obj,$single\_event\_main);

// breadcrumb
$single->display\_breadcrumb\_widget( get\_the\_ID() );

// Category Widget
$single->display\_category\_widget($single\_event\_obj);

// Cost Widget
$single->display\_cost\_widget($single\_event\_obj);

// Countdown Widget
$single->display\_countdown\_widget($single\_event\_main);

// Date Widget
$single->display\_date\_widget($single\_event\_o

// Export Widget
$single->display\_export\_widget($single\_event\_obj);

// Google map widget
$single->display\_map\_widget($single\_event\_main);

// Hourly
$single->display\_hourly\_schedules\_widget($single\_event\_obj);

// Label Widget
$single->display\_label\_widget($single\_event\_obj);

// Local Time widget
$single->display\_local\_time\_widget($single\_event\_obj);

// Location Widget
$single->display\_location\_widget($single\_event\_obj); // Show Location
$single->display\_other\_location\_widget($single\_event\_obj); // Show Additional Locations

// More info widget
$single->display\_more\_info\_widget($single\_event\_obj);

// next/prev widgets
$single->display\_next\_prev\_widget($single\_event\_obj);

// Organizer Widget
$single->display\_organizer\_widget($single\_event\_obj); // show Organizer
$single->display\_other\_organizer\_widget($single\_event\_obj); // additional Organizers

// QR widget
$single->display\_qrcode\_widget($single\_event\_obj);

// Register Button
$single->display\_register\_button\_widget($single\_event\_obj);

//Social
$single->display\_social\_widget($single\_event\_obj);

// Speakers widget
$single->display\_speakers\_widget($single\_event\_obj);

// Time Widget
$single->display\_time\_widget($single\_event\_obj);

// Weather Widget
$single->display\_weather\_widget($single\_event\_obj);

// Event Hourly Schedule
$single->display\_hourly\_schedules\_widget($single\_event\_obj);