Skip to content

Instantly share code, notes, and snippets.

@jesseeproductions
jesseeproductions / ecp-filter-title
Created October 20, 2014 23:52
Filter Single Event Title in the Events Calendar 3.8
/**
* Filter Single Event Title in the Events Calendar 3.8 to Remove Upcoming Events
*
*/
add_filter('tribe_events_title_tag', 'ecp_filter_single_title', 10, 4);
function ecp_filter_single_title( $title_filter, $new_title, $title, $sep ) {
if( tribe_is_event() && is_single() ) {
$title_filter = str_replace('Upcoming Events |', '', $title_filter);
@jesseeproductions
jesseeproductions / ecp-list-args
Created October 21, 2014 15:03
The Events Calendar List Widget Get Events from a Specific Month @3.8
/**
* The Events Calendar List Widget Get Events from a Specific Month @3.8
* $month_num is set manually to November
*/
add_filter( 'tribe_events_list_widget_query_args', 'customize_list_widget', 10, 1 );
function customize_list_widget( $tribe_args_list ) {
$month_num = '11';
$tribe_args_list['eventDate'] = date('Y') . "-$month_num-01 00:00:00";
@jesseeproductions
jesseeproductions / ecp-disable-ajax-month-list-day
Created October 27, 2014 15:48
Remove Ajax from The Events Calendar Pagination on Month, List, and Day Views
/*
* Remove Ajax from The Events Calendar Pagination on Month, List, and Day Views
* @3.8
*
*/
add_action('wp_print_scripts', 'events_calendar_remove_scripts' , 10);
function events_calendar_remove_scripts() {
wp_dequeue_script( 'tribe-events-calendar');
wp_dequeue_script( 'tribe-events-list');
@jesseeproductions
jesseeproductions / ecp-remove-gen-bc
Created October 27, 2014 18:42
Remove Genesis Breadcrumbs from the Event Calendar View Pages
/*
* Remove Genesis Breadcrumbs from the Event Calendar View Pages
* The Events Calendar @3.8
* Genesis @2.1.2
*/
add_action( 'genesis_before', 'tribe_remove_genesis_breadcrumbs' );
function tribe_remove_genesis_breadcrumbs() {
if( tribe_is_upcoming() || tribe_is_past() || tribe_is_map() || tribe_is_photo() || tribe_is_month() || tribe_is_week() || tribe_is_day() || tribe_is_photo() ) {
remove_action( 'genesis_before_loop', 'genesis_do_breadcrumbs' );
@jesseeproductions
jesseeproductions / ecp-puddate-filter-remove
Created October 28, 2014 17:39
The Events Calender Remove PudDate Filter in RSS that changes to Event Start Date
/*
* The Events Calender Remove PudDate Filter in RSS that changes to Event Start Date
* @3.8
*/
add_action( 'pre_get_posts', 'remove_events_pubdate_filter', 60 );
function remove_events_pubdate_filter() {
if ( is_feed() ) {
remove_filter( 'get_post_time', array( 'TribeEventsTemplates', 'event_date_to_pubDate' ), 10);
}
}
@jesseeproductions
jesseeproductions / ecp-list-style
Created October 29, 2014 00:05
CSS - The Events Calendar List Widget Styled like the Mini Calendar List
/*List Widget Styled like the Mini Calendar List of the Events Calendar */
.tribe-list-event-mini-styled {
border-bottom: 1px dotted #2f2f2f;
margin-bottom: 5px;
overflow: hidden;
padding-bottom: 5px;
width: 100%;
}
.tribe-list-event-mini-styled .list-date {
@jesseeproductions
jesseeproductions / list-widget
Created October 29, 2014 00:07
Events Calednar Pro List Widget Modified and Styled for to look like the Mini Calendar List
<?php
/**
* Events Pro List Widget Modified and Styled for to look like the Mini Calendar List
* The Events Calendar Pro @3.8
*
* This is the template for the output of the events list widget.
* All the items are turned on and off through the widget admin.
* There is currently no default styling, which is highly needed.
*
* Override this template in your own theme by creating a file at [your-theme]/tribe-events/widgets/list-widget.php
@jesseeproductions
jesseeproductions / ecp-filter-move
Created October 29, 2014 17:44
The Events Calendar Filter Bar - Move the Filter Bar Below the Title
/*
* The Events Calendar Filter Bar - Move the Filter Bar Below the Title
* @3.8
*/
add_action( 'wp_enqueue_scripts', 'removeTribeFilterBarDefaultDisplay', 50 );
function removeTribeFilterBarDefaultDisplay() {
$filterClass = TribeEventsFilterView::instance();
remove_action('tribe_events_before_template', array($filterClass, 'displaySidebar'), 25);
remove_action('tribe_events_bar_after_template', array($filterClass, 'displaySidebar'), 25);
@jesseeproductions
jesseeproductions / events-check-if-events
Created November 4, 2014 00:21
Check if there are Upcoming Events in the Events Calendar
<?php
/**
* Check if there are Upcoming Events in the Events Calendar
* @3.8
*/
$events = tribe_get_events( array('eventDisplay'=> 'list'));
// Check if any events were returned
if ( count( $events ) > 0 ) {
echo "Events";
@jesseeproductions
jesseeproductions / ecp-genesis-events-meta
Created November 17, 2014 20:52
Events Calendar Remove wp_title from Genesis and add custom function to replace
/*
* Genesis Remove Genesis Meta Filter on Event Calendar Pages
* The Events Calendar @3.8
* Genesis @2.1.2
*
*/
add_action( 'genesis_doctype', 'tribe_genesis_meta_title' );
function tribe_genesis_meta_title() {
if( tribe_is_upcoming() || tribe_is_past() || tribe_is_map() || tribe_is_photo() || tribe_is_month() || tribe_is_week() || tribe_is_day() || tribe_is_photo() ) {