Skip to main content

Google Calendar Sync User Guide

Step 1: Install Required Plugins and the Sync Plugin

First, make sure you have a working WordPress installation. You will need to install two essential plugins: Advanced Custom Fields (ACF) and Custom Post Type UI (CPT UI). Download and install ACF from Advanced Custom Fields and install CPT UI from the WordPress plugin repository. These two plugins are responsible for creating the custom fields and custom post type that your Google Calendar events will be saved into. Next, install and activate your Google Calendar ICS to ACF Sync plugin (using the code you have). This plugin will handle the process of fetching the ICS feed, parsing the events, and storing them in the custom fields created via ACF and CPT UI.

Step 2: Configure the Custom Post Type and ACF Field Group

Using the CPT UI plugin, go to the “Add/Edit Post Types” section and create a new custom post type with the slug “event.” Enter appropriate labels such as “Events” for the plural and “Event” for the singular. Save your settings so that the new “Event” post type appears in your WordPress admin sidebar. Next, configure the ACF field group: navigate to the ACF menu (Custom Fields) and click “Add New.” Create a field group titled “Google Calendar Event” and set it to appear for the “Event” post type. Within this group, add the necessary fields that will store the event information. For example, create a text field for “Event Title” with the field name “gcal_event_title,” a Date Time Picker field for “Event Date” with the field name “event_date” (set its display and return format to “Y-m-d H:i:s” or your preferred format), a textarea field for “Event Description” with the field name “event_description,” and a text field for “Event Location” with the field name “event_location.” Publish the field group to save your changes.

Step 3: Configure the Plugin’s Admin Settings

The sync plugin comes with its own admin settings page (accessible via a menu item called “ICS Sync”). In this page you will configure several options:

License Key Validation:

Enter your license key in the designated field. Click the “Validate” button, which will send an AJAX request to your license server using the same consumer credentials as your other plugin (Maps Uncensored). Once the license is verified, a message will display indicating that the license is saved and valid.

Google Calendar ICS URL:

Enter your Google Calendar ICS feed URL in the provided field. Make sure that your calendar is public and the URL is correct. Once you update the URL, click the “Update Calendar URL” button to save the change.

Cron Interval:

You can now adjust how frequently the plugin syncs your events by entering the desired cron interval (in seconds). For example, the default might be 10,800 seconds (3 hours). This interval controls the frequency at which WP Cron triggers the event sync.

Toggle for Upcoming Events:

There is a checkbox labeled “Show Upcoming Only.” When enabled, this option tells your dynamic content (or builder queries) to display only those events that have a start date equal to or later than the current date. This can be very useful for ensuring that only relevant, future events are shown on your site.

After entering all your settings, click the “Save Settings” button. You can also use the “Sync Google Calendar Now” button to manually trigger the synchronization process immediately.

Step 4: Syncing and Verifying Events

When you click the manual sync button, the plugin will fetch your ICS feed from the specified URL. It then parses the ICS data and converts the date and time information based on your site’s timezone (configured in WordPress settings) into the “Y-m-d H:i:s” format (or your custom format). For each event found, the plugin checks if an event with the same title and date already exists. If it doesn’t, the plugin creates a new “Event” post and uses ACF’s update_field() function to populate the fields (such as “gcal_event_title”, “event_date”, “event_description”, and “event_location”) as defined by your ACF field group. After syncing, you can navigate to the “Events” section in your WordPress admin to verify that the events have been imported correctly and that the custom fields display the expected values.

Step 5: Using Events in Yoostheme Builder

Since your events are stored as custom posts with an ACF field group attached, Yoostheme Builder will be able to detect and use the dynamic fields when you build your layouts. In the builder’s dynamic content settings, you should now see your ACF fields (for example, Event Date, Event Title, etc.) available for selection. If you have enabled the “Show Upcoming Only” toggle, ensure that your builder’s query (or your custom query) takes this setting into account so that only future events (relative to the current date) are displayed.

Step 6: Cron Job and Automatic Sync

The plugin automatically schedules a WP Cron job based on the interval you have set. This means that after activation, the plugin will continue to sync your events from Google Calendar automatically at the defined interval. To verify that the cron job is working, you can use a plugin like WP Crontrol to inspect scheduled events. If you ever need to adjust the frequency, simply change the value in the admin settings and save.

Step 7: Troubleshooting and Additional Notes

If events are not appearing as expected, double-check that the ICS URL is correct and that your calendar is public. Enable WP_DEBUG in your wp-config.php file to view error messages logged by the plugin. Also verify that the ACF field group is correctly assigned to the “Event” post type and that the field names exactly match those used by the plugin. If license validation is failing, ensure that your server is able to connect to the license endpoint and that the consumer credentials are set correctly.

By following this detailed guide, you should be able to set up ACF, CPT UI, and the Google Calendar ICS Sync plugin so that your events are imported correctly, dynamically integrated with Yoostheme Builder, and styled with an admin interface that matches your other plugins. Enjoy your new setup and the streamlined process for managing your calendar events on your website!

Other User Guides