Skip to content

Instantly share code, notes, and snippets.

@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 / 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 / remove-venue-link.php
Created March 13, 2019 18:38
Remove link from venue name on event page
@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 / related-events-venues.php
Last active March 12, 2019 23:36
Use venues for related events instead of categories
@jentheo
jentheo / index.php
Created February 27, 2019 11:24
Tweak to allow extension to work with tribe_events shortcode
<?php
/**
* Plugin Name: The Events Calendar PRO Extension: Display multiple events with the same venue in Map tooltips.
* Description: Show multiple events with the same venue in PRO's map tooltips.
* Version: 1.1
* Extension Class: Tribe__Extension__Multiple_Events_Same_Venue
* Author: Modern Tribe, Inc.
* Author URI: http://m.tri.be/1971
* License: GPLv2 or later
* License URI: https://www.gnu.org/licenses/gpl-2.0.html
@jentheo
jentheo / open-graph-events-archive.php
Created February 26, 2019 16:27
Add open graph tags to event archive pages
/**
* The Events Calendar: Add Open Graph to <head> of Events Archive views.
*
* @link https://gist.github.com/cliffordp/5ed25b8bfb024efe73d1ce6c42d960aa
* @link http://ogp.me/
*/
function cliff_add_open_graph_tec_archive_views() {
// !!! CHANGE THIS URL !!!
$tec_archive_view_og_image_url = 'https://theeventscalendar.com/content/uploads/2013/07/screenshots4-2_single-event.png';
@jentheo
jentheo / mobile-styles.php
Last active February 23, 2019 17:52
Enqueue mobile styles
function theme_enqueue_styles() {
wp_register_style('tribemobile', '/wp-content/plugins/the-events-calendar/src/resources/css/tribe-events-full-mobile.min.css', array(), '1.0', '(max-width: 801px)');
wp_enqueue_style('tribemobile', false, array(), false, '(max-width: 801px)');
}
add_action( 'wp_enqueue_scripts', 'theme_enqueue_styles' );
@jentheo
jentheo / hide-recurrence.php
Last active February 22, 2019 04:10
Hide recurrence on home page
function tribe_hide_recurrence_on_homepage( $hide ) {
if ( is_front_page() ) {
$hide = true;
}
return $hide;
}
add_filter( 'tribe_events_pro_should_hide_recurrence', 'tribe_hide_recurrence_on_homepage' );
@jentheo
jentheo / single-event.php
Created February 21, 2019 00:04
Add city and state to event title in 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
*