Good news:

Our new product, Power VC Add-on, entered the market. By this plugin you can use new added tools and options to Visual Composer.

1- copy/paste rows across pages, 2- Scroll animations, 3- Advanced parallax background, 4- Unique demo pages, 5- 160 modern design shortcodes (fully responsive)

Click to Visit The Plugin

Okay
  Print

If you're going to include the Modern Events Calendar into your theme, then please note to the followings as a guide.

Including the MEC

For including the Modern Event Calendar plugin you can simply use TGMPA plugin. It works fine completely with this plugin.

For better User Experience, MEC imports some events and shortcodes upon activation. If you want to disable this feature for any reason, you can use two following filters:

Disabling Dummy Events

add_filter('mec_activation_import_events', '__return_false');

Disabling Dummy Shortcodes (Not Recommended if you're not going to add your own shortcodes!)

add_filter('mec_activation_import_shortcodes', '__return_false');

Importing Demo Data

You can insert your own dummy data into the MEC simply. There are three main concepts for data importing.

Importing Events

MEC events are created by WP post type + a record in [wp_prefix]_mec_events table so you should import both otherwise the event is incomplete and it won't show on the frontend of the website. For importing the post types, you can simply use the solution that you use for other post types such as post, page etc.

For the mec_events records, we suggest to create a sql export file from your mec_events table on your demo website and then write a simple PHP code to run the .sql file queries into the client website. You can use some code like the following:

$query_file = '/path/to/mec_events.sql';
$queries = file_get_contents($query_file);
$sqls = explode(';', $queries);
// WordPress DB
global $wpdb;
foreach($sqls as $sql)
{
    $sql = trim($sql, '; ');
    if(trim($sql) == '') continue;
                
    $sql .= ';';
    
    $wpdb->query($sql);
}

Note: You should take care about the WP table prefix. We suggest to change the prefix in the sql file to something unique. For example change the INSERT INTO wp_mec_events to INSERT INTO #__mec_events in the sql file and replace #__ with $wpdb->prefix before calling the query.

As another approach you can assign the queries to a PHP variable and then run it by $wpdb->query() function. Something like following:

global $wpdb;
$query = "INSERT INTO ".$wpdb->prefix."mec_events ......";
$wpdb->query($sql);

Note: The post_id column of mec_events table should be equals to the Post ID of event otherwise they won't link together.

Importing Shortcodes

If you're exporting the shortcodes from your demo website and importing them into the client website. Please take care of predefind filtering options. For example the shortcode on your demo website may be set to show events of "BlahBlah" category but this category may not exists on client website so the shortcode simply don't find any events and it shows "No Event!" message at the frontend. The best approach is to completely reset predefind options of the shortcodes.

These meta fields should be empty in the shortcodes:

  1. label
  2. category
  3. location
  4. organizer
  5. tag
  6. author

BTW, If you want to import pre-filtered shortcodes into the client website, then make sure that the taxonomies exists on client website and the events are assigned to that taxonomy correctly otherwise the shortcode won't find anything due to mis-configuration.

Importing Taxonomies

You can use the current solution that you use for importing other WP taxonomies such as tags, categories, etc.

Overriding MEC Templates

The MEC is created by developers for developers! and it's highly developer friendly so you can simply override MEC templates into your theme and make it compatible with your theme style or use MEC filters/actions to customize it.

The MEC has some template files in the /path/to/modern-events-calendar/templates/ path, you can simply override them into your theme or child-theme. For example place them on the /path/to/theme/single-mec-events.php or /path/to/child-theme/single-mec-events.php

Overriding MEC Skin Templates

The MEC supports many skins for showing events and all of them are override ready! For example if you want to customize grid skin of MEC, then you can simply put the /path/to/modern-events-calendar/app/skins/grid/render.php into the /path/to/theme/webnus/modern-events-calendar/app/skins/grid/render.php

You can do it for all template files of all skins including single skin that is for showing single event page, monthly_view, full_calendar, cover, etc.

BTW, we recommend you to avoid overriding the files as much as you can and try to make it compatible with your theme using CSS/JS becuase if you override the files on your theme, then your clients may not be able to use new features of MEC after automatic update.

Please feel free to contact us if you have any questions. We will be more than happy to help you.