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

Events v2 it is now possible to set sorting by “Event Date Ascending” & “Event Date Descending”.

So it can be achieved to sort nearest past events with selecting event type to “Past Events” & event date sorting to “Descending”.

Tabs

Search

Design

GD > Events Calendar

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:

GD > Linked Posts

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"]

GD > Listings

GD Listings is the most powerful element for querying and displaying listings, and it has special options for listings that are also events.

Link to Events by Month

Requires Advanced Search addon

You can link to any events period by linking to the search results for the events period. So, to do that, do a search for the events period, grab the URL, and make a link where your visitors can find it.

Step by Step

  1. Add event dates to your search bar – Visit the Advanced search tab for the events CPT and add event dates. Set the options to include start and end dates.
  2. Do a search – Visit one of your site pages with a search bar and make a search. For example, start date May 1, end date May 31. Click search.
  3. Copy the URL – When the search results return, copy the URL from your browser bar.
  4. Make a link (as a menu item) – Add a new menu item. Choose “Custom Link” and paste in the URL, then titls the link as “May Events”.
  5. Save the menu and test – Save the menu, then visit your site and find the item. Click to verify you got it right.

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