Skip to content

Instantly share code, notes, and snippets.

@jentheo
jentheo / related-events-venues.php
Last active March 12, 2019 23:36
Use venues for related events instead of categories
@jentheo
jentheo / fixed-header-divi-fix.php
Last active March 15, 2019 19:37
Fix issue with et-fixed-header not being applied on single event pages in Divi
<script>
(function($) {
$(window).scroll(function() {
var scroll = $(window).scrollTop();
if (scroll >= 100) {
//clearHeader, not clearheader - caps H
$("#main-header").addClass("et-fixed-header");
}
});
@jentheo
jentheo / remove-venue-link.php
Created March 13, 2019 18:38
Remove link from venue name on event page
@jentheo
jentheo / schedule-details.php
Last active April 30, 2019 13:26
Reformat schedule details for multi-day events
function tribe_reformat_schedule_details( $schedule, $event_id, $before, $after ) {
if ( tribe_event_is_multiday( $event_id ) ) {
$start_date = tribe_get_start_date( $event_id, false, 'F j' );
$end_date = tribe_get_end_date( $event_id, false, 'F j' );
$end_date = strncmp( $start_date, $end_date, 3 ) === 0 ? tribe_get_end_date( $event_id, false, 'j' ) : $end_date;
$start_time = tribe_get_start_time( $event_id );
$end_time = tribe_get_end_time( $event_id );
@jentheo
jentheo / single-event.php
Created May 1, 2019 19:31
Remove link to single event page from month view
<?php
/**
* Month Single Event
* This file contains one event in the month view
*
* Override this template in your own theme by creating a file at [your-theme]/tribe-events/month/single-event.php
*
* @package TribeEventsCalendar
* @version 4.6.21
*
@jentheo
jentheo / temp-fix-embedded-month-view-day-links.php
Last active May 2, 2019 16:04 — forked from barryhughes/temp-fix-embedded-month-view-day-links.php
Provides a temp workaround to help ensure the more event/view all X event links within month view are functional
@jentheo
jentheo / next-day-event-link.php
Last active May 7, 2019 15:13
Next day event link
@jentheo
jentheo / loop-grid.php
Created May 13, 2019 16:38
Show week numbers in month view
<?php
/**
* Month View Grid Loop
* This file sets up the structure for the month grid loop
*
* Override this template in your own theme by creating a file at [your-theme]/tribe-events/month/loop-grid.php
*
* @package TribeEventsCalendar
* @version 4.6.19
*
@jentheo
jentheo / past-events-on-categories.php
Created May 17, 2019 14:41
Show past events on event category pages
function tribe_set_default_date( $wp_query ) {
// Only run on main event queries
if ( ! tribe_is_event_query() || ! $wp_query->is_main_query() || $wp_query->get( 'eventDate' ) != '') return;
// Set this to the date you want shown, in YYYY-MM-DD format
$date = '2000-01-01';
// Select which TEC views you want this to apply to by uncommenting them
if (
tribe_is_event_category()
@jentheo
jentheo / hide-recurring-events.php
Created May 24, 2019 13:58
Hide recurring event instances in list views
function tribe_hide_recurring_events( $hide, $query ) {
if ( tribe_is_list_view() || tribe_is_photo() || tribe_is_map() ) {
$hide = true;
}
return $hide;
}
add_filter( 'tribe_events_pro_should_hide_recurrence', 'tribe_hide_recurring_events', 10, 2 );