1. Home
  2. Docs
  3. Addons
  4. Events

Events


Introduction
Installation
Settings
CPT Events
Design
Support

Introduction

Allow your site users to create events with start and end dates. With the Events addon and Custom Post Types addon together any new Custom Post Type can be turned into an event. Get the Events add-on for GeoDirectory and get started.

See more here: https://wpgeodirectory.com/downloads/events/

Installation

Preparation

Check to be sure you have the following plugins installed before you get started.

Installation

  1. Download the Addon from your account.
  2. Install the Addon.

Settings

Time

Custom Post Types Events

Custom Fields

Sorting

Tabs

Search

Design

Widgets

GD > Events Calendar

Shortcodes

geodir_event_calendar :

[geodir_event_calendar title="GD Events Calendar" post_type="gd_event" week_start_day="1" week_day_format="0"]

Shortcode builder options:

Template Shortcodes

The Custom Post Types addon allows you to design custom templates for each post type.

The following shortcodes can be used to display data in templates:

[gd_post_meta key="recurring"]
[gd_post_meta key="event_dates"]

To add events to the Location page you can start with this GD Listings shortcode. If you want to personalize it, use a block for GD Listings and adjust the values. Be sure to check the advanced options. To add this shortcode, edit the location page and add an HTML block and paste the shortcode into the block.

[gd_listings title="Places" post_type="gd_event" event_type="upcoming" single_event="1" sort_by="event_dates_asc" title_tag="h3" layout="gridview_onefifth" post_limit="200" add_location_filter="1" view_all_link="1" with_pagination="1"]

Get Support

Get support on our forum, fnd out more here: https://wpgeodirectory.com/docs-v2/v2/support/

Set event time interval

By default event time is set in 15 minute increments. Use the snippet below to set the increment to your needs.

/**
 * Set event fields time interval.
 */
function gd_snippet_190307_event_time_increment( $interval ) {
	$interval = 30; // In minutes
	
	return $interval;
}
add_filter( 'geodir_event_time_increment', 'gd_snippet_190307_event_time_increment', 10, 1 );

GD Categories with Events

By default the CPT listing page will show only listings that pass the default events filter. For example, if the filter is set to upcoming, then only upcoming events will be shown.

GD Categories does not use the events filter and will show all events.

URL Event Filters

In some cases you may want to provide a link to all, past, or only upcoming events. The following can be added to any event CPT URL to filter the listings, including category or category+location URLs.
The examples are for a CPT with the URL slug /events/

events/?etype=all
events/?etype=upcoming
events/?etype=past

Was this article helpful to you? Yes 1 No