Skip to content
No results
MEC Knowledgebase
  • Installation
    • Installation
    • Activation
    • Auto Update
    • Manual Update
    • Change License Domain
  • Settings
    • General
    • Archive Page
    • Slugs/Permalinks
    • Currency
    • View All
  • Single Event
    • Single Event Settings
    • How to Add Event In MEC Plugin?
    • MEC Single Sidebar
    • Custom Fields
    • View All
  • Event Modules
    • Speakers
    • Organizers
    • Locations
    • Map
    • View All
  • Booking Settings
    • Booking Module
    • Booking Elements
    • Booking Form
    • Payment Gateways
    • View All
  • Event Submission
    • General
    • Access Level
    • FES Sections
    • Required Fields
    • View All
  • Integrations
    • Mailchimp
    • Paid Memberships Pro
    • BuddyPress
    • LearnDash
    • View All
  • Notifications
    • Booking Notification
    • Booking Confirmation
    • Booking Reminder
    • Admin Notification
    • View All
  • Addons
    • Elementor Single Builder Addon
    • Ticket and Invoice Addon
    • Event Seat Addon
    • Virtual Events Addon
    • View All
  • Other
    • Appearance Settings
    • Translation
    • Knowledge
    • Troubleshooting
    • Developer
MEC Knowledgebase

  • Categories
    • Installation
      • Installation
      • Activation
      • Auto Update
      • Manual Update
      • Change License Domain
    • General Settings
      • General
      • Archive Pages
      • Slugs/Permalinks
      • Currency
      • View All
    • Single Event
      • Single Event Settings
      • MEC Single Sidebar
      • How to Add Event In MEC Plugin?
      • Custom Fields
      • View All
    • Event Modules
      • Speakers
      • Organizers
      • Locations
      • Map
      • View All
    • Booking Settings
      • Booking Module
      • Add a Booking System
      • Booking Form
      • Organizer Payment Settings
      • View All
    • Event Submission
      • General
      • Access Level
      • FES Sections
      • Required Fields
      • View All
    • MEC Integrations
      • Mailchimp
      • BuddyPress
      • LearnDash
      • Paid Memberships Pro
      • View All
    • Notifications
      • Booking Notification
      • Booking Confirmation
      • Booking Reminder
      • Admin Notification
      • View All
    • Addons
      • Elementor Single Builder Addon
      • Ticket and Invoice Addon
      • Event Seat Addon
      • Virtual Events Addon
      • View All
    • Other
      • Appearance Settings
      • Translation
      • Knowledge
      • Troubleshooting
      • Developer

Submit a Ticket
MEC Knowledgebase

Toggle
  • Overriding Single Event Page
  • Creating a PHP file in the theme folder
  • Supported PHP functions
  • Modern Events Calendar Widgets

Developer

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 templates in your 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 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 

#NameCode
01Titleget_the_title(); / the_title();
02Contentget_the_content(); / the_content();
03Thumbnailthe_post_thumbnail(); / the_post_thumbnail(‘full’);
04Tagget_the_tags();
05Labelget_terms( array(‘taxonomy’ => ‘mec_label’,’hide_empty’ => false,));
06Categoryget_terms(array(‘taxonomy’ => ‘mec_category’,’hide_empty’ => false,));
07Event Colorget_post_meta( get_the_ID(), ‘mec_color’, true );
08Start Dateget_post_meta( get_the_ID(), ‘mec_start_date’, true );
09Start Hoursget_post_meta( get_the_ID(), ‘mec_start_time_hour’, true);
10Start Minuteget_post_meta( get_the_ID(), ‘mec_start_time_minutes’, true);
11Start AM/PMget_post_meta( get_the_ID(), ‘mec_start_time_ampm’, true);
12End Dateget_post_meta( get_the_ID(), ‘mec_end_date’, true );
13End Hoursget_post_meta( get_the_ID(), ‘mec_end_time_hour’, true);
14End Minuteget_post_meta( get_the_ID(), ‘mec_end_time_minutes’, true);
15End AM/PMget_post_meta( get_the_ID(), ‘mec_end_time_ampm’, true);
16MEC Commentget_post_meta( get_the_ID(), ‘mec_comment’, true );
17Read Moreget_post_meta( get_the_ID(), ‘mec_read_more’, true);
18More Infoget_post_meta( get_the_ID(), ‘mec_more_info’, true);
19Costget_post_meta( get_the_ID(), ‘mec_cost’, true );
20Event Excerptget_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);

Share

Report Out Dated Content

If you think the content of this page does not reflect updated information, please let us know.

Report Now
Login Submit
42 Comments
latatazaza August 24, 2022
| |

Hello,
i ve a pb with this two vars : get_post_meta( get_the_ID(), ‘mec_end_time_minutes’, true); get_post_meta( get_the_ID(), ‘mec_start_time_minutes’, true);
when i choose a hour like this in the back office  8:05 AM he returns 8:5 on the front 
Other ? is there a var in oder to have the duration of an event ?
Thanks 

0 0
0
Reply
Abraham Baker September 11, 2022
| |
latatazaza Hello, i ve a pb with this two vars : get_post_met

Hi there
Thank you for contacting us
Please refer to webnus.net/support to create a ticket there.
Our experts will help you with it.

0 0
0
Reply
nipapis July 21, 2022
| |

Anyone idea about displaying custom field? 
I’ve tried this but it doesn’t worked
get_post_meta( get_the_ID(), ‘mec_event_data_event_field_1’, true );
 
Do anyone have find how to get custom field data to single event? Let me know here on reply.

0 0
0
Reply
Abraham Baker August 11, 2022
| |
nipapis Anyone idea about displaying custom field?  I've

Hi,
Please ask this at webnus.net/support from our technical team. They will get back to you with the reply. Thanks!

0 0
0
Reply
behaugabook July 12, 2020
| |

IS there a shortcode for the event post (single event)? I want to be able to use my website skin and header for this page. 

2 0
0
Reply
Swan1305 September 20, 2020
| |
behaugabook IS there a shortcode for the event post (single ev

This is exactly what I need too, such a great looking plugin but no good without that sadly. 

0 0
0
Reply
Sarah Wang September 26, 2020
| |
Swan1305 This is exactly what I need too, such a great look

Hello,
I will forward your comments to the dev team and if possible they will consider this in the upcoming update of the plugin.

0 0
0
Reply
Sarah Wang August 5, 2020
| |
behaugabook IS there a shortcode for the event post (single ev

Hello,
Unfortunately, there is no single event shortcode.

0 0
0
Reply
cristo66 July 1, 2020
| |

Hi
With recurring weekly events (eg. classes), is it possible to have the booking modal date dropdown default to the actual date selected, rather than just the next available?

0 0
0
Reply
Sarah Wang July 6, 2020
| |
cristo66 Hi With recurring weekly events (eg. classes), is

Hello,
if I understand you correctly. Head over to MEC Settings > Single Event > Single Event Page and select the ‘Referred date’ for the date method option, and check again to see if it’s OK now.
https://webnus.net/dox/modern-events-calendar/date-method-application-in-mec-plugin/

if the issue remains, please go to support.webnus.net and there you can log in or sign up. to create a new ticket, simply head over to webnus.net/support and click on ‘Create a Ticket’ and share the required information.

0 0
0
Reply
caroline June 9, 2020
| |

Hi, working with the modern event calendar light is great! (I’m planning to update to the Pro Version soon!)
I am currently overriding the single-mec-events.php file. I use the widgets described above and some of them are not correctly translated into German, even though the corresponding translation file exists. (I already checked using Poedit.)
 
The

titles of the following widget function do not translated correctly:display_date_widget(), display_time_widget(), display_cost_widget(), display_location_widget(), display_social_widget()
The main

title of the display_organizer_widger() is correctly translated, but the

titles (Phone, Email, Website) are not translated.
For the display_date_widget() and the display_time_widget() I found a (dirty) fix by correcting the translation command on line 653 and 752 in the single.php file (modern-events-calendar-lite/app/skins/single.php).
 
 
Here is my solution to get the correct translation for the display_time_widget() function.
 
Original code (line 752):


 
My solution:


 
Would be great, if you could fix these issues soon. 🙂

0 0
0
Reply
Sarah Wang June 26, 2020
| |
caroline Hi, working with the modern event calendar light i

Hello,
We forwarded this to our developer team and they will check this and change it if possible in the upcoming updates of the plugin.
Thank you for sending this to us.

0 0
0
Reply
Load More

Still no luck? We can help!

If you did not find what you were looking for, please submit a ticket in our support system.

Submit a Ticket
Webnus Banner
Modern Events Calendar

Please read our Terms and Conditions and Privacy Policy.

Review us on Trustpilot

Copyright © 2023. All rights reserved. Webnus Inc.