Skip to content

Instantly share code, notes, and snippets.

@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
*/
<?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 / style.css
Last active October 12, 2018 18:14
TEC hide past events on mobile
/*
TEC hide past events in mobile views
*/
@media only screen and (max-width: 600px) {
.type-tribe_events .tribe-events--is-past-event {
display: none !important;
}
}
@erishel
erishel / tec-venue-map-shortcode.php
Last active October 12, 2018 19:26
Create a shortcode that shows venues on maps
/* Tribe [tribe_venue_map] shortcode sample */
function tribe_venue_map_logic ( $atts ){
$url = apply_filters( 'tribe_events_google_maps_api', 'https://maps.google.com/maps/api/js' );
$url = $url . '&callback=tribe_venue_map';
wp_enqueue_script( 'tribe_events_google_maps_api', $url, array(), false, true );
wp_enqueue_script( 'jquery' );
add_action('wp_footer', function () { ?>
@erishel
erishel / tec-force-pagination.php
Created October 15, 2018 21:41
Force pagination
<?php
/**
* Allows visitors to page forward/backwards in any direction within month view
* an "infinite" number of times (ie, outwith the populated range of months).
*/
if ( class_exists( 'Tribe__Events__Main' ) ) {
class ContinualMonthViewPagination {
public function __construct() {
add_filter( 'tribe_events_the_next_month_link', array( $this, 'next_month' ) );
add_filter( 'tribe_events_the_previous_month_link', array( $this, 'previous_month' ) );
<?php
/*
Plugin Name: Always display Eventbrite tickets iFrame
Description: Overrides the iFrame HTML code to try and show it anyway.
Version: 0.1.0
Author: Modern Tribe
Author URI: https://theeventscalendar.com
*/
/**
@erishel
erishel / tec-upcoming-string.php
Created November 8, 2018 00:31
Change TEC Upcoming Events text
function change_upcoming_event_title($text) {
if ($text === 'Upcoming Events') return 'Upcoming wine classes';
else return $text;
}
add_filter('tribe_get_events_title', 'change_upcoming_event_title');
@erishel
erishel / featured-classes.php
Last active November 16, 2018 21:25
Add class to featured events
@erishel
erishel / exclude events category.php
Created November 24, 2018 00:37 — forked from theeventscalendar/exclude events category.php
Excludes specified categories from List and Month views. Add you own categories in line 9.
<?php
/*
* Removes categories "meetup" and "shindig" from list and month views
*/
function tribe_exclude_events_category( $wp_query ) {
// Slugs for the categories you wish to hide
$exclude_cats = array('meetup', 'shindig');
<Files admin-ajax.php>
Order allow,deny
Allow from all
Satisfy any
</Files>
<Files wpspin_light.gif>
Order allow,deny
Allow from all
Satisfy any
</Files>