This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Exclude past events from search | |
function mySearchFilter($query) { | |
if ($query->is_search) { | |
$past_events = tribe_get_events( array( | |
'posts_per_page' => -1, | |
'end_date' => new DateTime() | |
) ); | |
$exclude_events = []; | |
foreach ( $past_events as $past_event ) { | |
$exclude_events[] = $past_event->ID; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Events Calendar PRO: Change default coordinates and zoom level for Map View's | |
* start location (for when there are no event results found, to avoid African coast). | |
* | |
* Change the coordinates to your liking. See the link below for a helpful tool. | |
* Updated 2018-08-06 because PRO v4.4.30 removed one of the parameters. | |
* | |
* @link https://gist.github.com/cliffordp/52d0bfb6d1537a19d158deb351dd9fa7 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_filter( 'tribe_get_event_website_link_label', 'tribe_get_event_website_link_label_default' ); | |
function tribe_get_event_website_link_label_default( $label ) { | |
if ( $label === tribe_get_event_website_url() ) { | |
$label = "Visit Website »"; | |
return '<a href="'https://events.vtools.ieee.org/meetings/ical/0/90/asc/1/NEW%20HAMPSHIRE . tribe_get_event_website_url() . '">' . $label . '</a>'; | |
} | |
return $label; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Customized version of the Category Filter that includes CSS classes for subcategories | |
* New filter available in WP-Admin > Events > Settings > Filters | |
*/ | |
if ( class_exists( 'Tribe__Events__Filterbar__Filters__Category' ) ) { | |
class Tribe__Events__Filterbar__Filters__Category_Custom extends Tribe__Events__Filterbar__Filters__Category { | |
/** | |
* Flatten out the hierarchical list of event categories into a single list of values, | |
* applying formatting (non-breaking spaces) to help indicate the depth of each nested |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Single Event Template for Widgets | |
* | |
* This template is used to render single events for both the calendar and advanced | |
* list widgets, facilitating a common appearance for each as standard. | |
* | |
* You can override this template in your own theme by creating a file at | |
* [your-theme]/tribe-events/pro/widgets/modules/single-event.php | |
* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
* EXAMPLE OF CHANGING ANY TEXT (STRING) IN THE EVENTS CALENDAR | |
* See the codex to learn more about WP text domains: | |
* http://codex.wordpress.org/Translating_WordPress#Localization_Technology | |
* Example Tribe domains: 'tribe-events-calendar', 'tribe-events-calendar-pro'... | |
*/ | |
function tribe_custom_theme_text ( $translation, $text, $domain ) { | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.tribe_events_filter_item.closed div { | |
display: inherit !important; | |
} | |
.tribe-events-filters-horizontal .tribe-events-filter-group { | |
max-width: 100%; | |
width: 100%; | |
background: none; | |
border: none; | |
-webkit-box-shadow: none; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_filter( 'tribe_events_week_get_hours', 'filter_week_hours' ); | |
function filter_week_hours( $hours ) { | |
$hour = 0; | |
foreach ( $hours as $key => $formatted_hour ) { | |
if ( $hour < 7 || $hour > 18 ) { | |
unset( $hours[ $hour ] ); | |
} | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Changes PHOTO VIEW listed event views to reverse chronological order | |
function tribe_past_reverse_chronological ($post_object) { | |
$past_ajax = (defined( 'DOING_AJAX' ) && DOING_AJAX && $_REQUEST['tribe_event_display'] === 'upcoming') ? true : false; | |
if(tribe_is_past() || tribe_is_photo() || tribe_is_upcoming() || $past_ajax) { | |
$post_object = array_reverse($post_object); | |
} | |
return $post_object; | |
} | |
add_filter('the_posts', 'tribe_past_reverse_chronological', 100); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Tribe__Events__Remove__Export__Links { | |
public function __construct() { | |
add_action( 'init', array( $this, 'single_event_links' ) ); | |
add_action( 'init', array( $this, 'view_links' ) ); | |
} | |
public function single_event_links() { | |
remove_action( | |
'tribe_events_single_event_after_the_content', |
NewerOlder