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
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”.
Once Event Dates has been added to the sorting options, a new set of sorting options will appear on Archive pages using the gd_loop_actions element with several types of specific event sorts.
Tabs
Search
The search tab will, by default, be configured with search by Add Date. You will want to change this by
Removing Add Date
Clicking on Event Dates
Adjust options to add to search bar if desired
Design
GD > Events Calendar
[geodir_event_calendar title="GD Events Calendar" post_type="gd_event" week_start_day="1" week_day_format="0"]
GD > Output Location
Show your event information in Listings on the Archive page and in the Details page sidebar with GD Output Location
- Edit the archive item template
- Make sure there is a GD Output Location element -> Listing or Details Page Sidebar
- Visit Events CPT -> Custom Fields -> Event Date -> Show in what locations -> Listings
- Save both and view your CPT Archive for the results
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.
GD Listings to Show Events in a Timeframe
GD Listings for event CPTS gives you some choices about displaying events. You can show events just for tomorrow, just today, or just the weekend, for example.
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
- 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.
- 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.
- Copy the URL – When the search results return, copy the URL from your browser bar.
- 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”.
- Save the menu and test – Save the menu, then visit your site and find the item. Click to verify you got it right.
Customizing
For more information about using code snippets please see our doc about customizing.
Make GD Linked Posts show Only Upcoming Events
This requires a snippet that can be found here:
https://wpgeodirectory.com/support/topic/show-all-events-of-a-location-on-location-site/#post-466575
Event Search results by soonest
See the original topic
Custom Input Format
GeoDirectory events provides several input formatts to choose from. If you need to add another it can be done with a customization with a filter:
geodir_event_input_date_formats
Example:
function gd_snippet_event_input_date_formats( $formats ) { // $formats[] = 'Y-m-d' return $formats; } add_filter( 'geodir_event_input_date_formats', 'gd_snippet_event_input_date_formats', 10, 1 );
Recurring date display
Alter the display of recurring dates with CSS or a PHP snippet.
Hi Jorge,
We have already task in todo to enhance displaying event schedules. It will in future as we have important tasks with higher priority.
/*GDV2 Events – Add scroll bar to limit height of recurring dates*/ .geodir-company_info .geodir-field-event_dates .geodir-schedules { max-height: 192px; overflow-x: hidden; overflow-y: auto; }
Use a PHP Snippet to show only the current and upcoming recurrences.
#sidebar .geodir-field-event_dates .geodir-schedules .geodir-schedule { display: none; } #sidebar .geodir-field-event_dates .geodir-schedules .geodir-schedule:first-child, #sidebar .geodir-field-event_dates .geodir-schedules .geodir-schedule.geodir-schedule-current { display: block; }
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