Skip to content

Instantly share code, notes, and snippets.

<?php
/**
* Single Event Meta Template
*
* Override this template in your own theme by creating a file at:
* [your-theme]/tribe-events/modules/meta.php
*
* @version 4.6.10
*
* @package TribeEventsCalendar
@erishel
erishel / tex-pagination-fix.php
Created June 13, 2018 01:43
Fix AJAX issues with The Events Calendar and some themes
<?php
/*
Plugin Name: Events Calendar Pagination Fix
Plugin URI: https://tri.be
Description: Fix pagination issues with TEC and certain themes
Author: Modern Tribe (Ed)
Version: 1.1
Author URI: https://tri.be
License: GPL2
*/
@erishel
erishel / tribe_prevent_ajax_paging.php
Created June 12, 2018 17:41 — forked from elimn/tribe_prevent_ajax_paging.php
MT | TEC | Prevent Next/Prev pages from being loaded via Ajax in List and Month views
<?php
/*
* Prevents Next/Prev pages from being loaded via Ajax in List and Month views
*/
function tribe_prevent_ajax_paging() {
echo "
<script>
jQuery(document).ready(function(){
@erishel
erishel / tooltip.php
Last active June 2, 2018 20:45 — forked from nefeline/tooltip.php
Adds permalink to bottom of tooltip
<?php
/**
* Adds permalink to bottom of tooltip
*
* Add this template on:
*
* [your-theme]/tribe-events/month/tooltip.php
*/
?>
function vehicle_details() {
// Add new "Vehicle Details" taxonomy
register_taxonomy('vehicle_details', 'vehicle', array(
// Hierarchical taxonomy (like categories)
'hierarchical' => true,
'public' => true,
@erishel
erishel / sample functions with changed text.php
Created May 24, 2018 01:31 — forked from theeventscalendar/sample functions with changed text.php
This is an example of a functions.php file with custom text added.
<?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 ) {
/*-----------------------------------------------------------------------------------*/
/* The Events Calendar - Conditional Logic to Detect Various Event Related Views/Pages
/*-----------------------------------------------------------------------------------*/
if ( tribe_is_month() && ! is_tax() ) { // Month View Page
echo 'were on the month view page';
} elseif ( tribe_is_month() && is_tax() ) { // Month View Category Page
@erishel
erishel / change_events_view_titles.php
Created May 19, 2018 01:43 — forked from theeventscalendar/change_events_view_titles.php
Changes the title/headings on Events views
<?php
/*
* Alters event's archive titles
*/
function tribe_alter_event_archive_titles ( $original_recipe_title, $depth ) {
// Modify the titles here
// Some of these include %1$s and %2$s, these will be replaced with relevant dates
$title_upcoming = 'Upcoming Events'; // List View: Upcoming events
@erishel
erishel / experimental-smart-month-search.php
Created May 17, 2018 23:56 — forked from barryhughes/experimental-smart-month-search.php
Improve month view search so it is not restricted to the current month. Experimental! Use at own risk, there are known bugs/quirks with this code.
<?php
/**
* If a search is conducted in month view but the relevant events
* are in a different month, switch to that month.
*
* Experimental! Especially during live ajax navigation, there are
* parts of this that don't work cleanly (pushstate/URL changes).
* Unsupported, use at own risk.
*/
class Transmogrified_Month_View_Search {
//Add to functions.php
add_filter( 'tribe_get_events_title', 'change_month_title_wording' );
function change_month_title_wording( $title ) {
return str_replace( 'Events for', '', $title );
}