Skip to content

Instantly share code, notes, and snippets.

@theeventscalendar
theeventscalendar / List Widget order by publication.php
Created June 4, 2015 22:35 — forked from barryhughes/list-widget-order-by-publication.php
Make one, some or all list widgets (advanced/PRO and regular/core) show events in publication order (most recent first)
class EventsListWidget_NewlyAddedEvents {
protected $constraints = array(
'sidebar_id' => null,
'widget_id' => null,
'widget_title' => null
);
public function __construct( array $constraints = array() ) {
$this->constraints = array_merge( $this->constraints, $constraints );
add_filter( 'widget_display_callback', array( $this, 'setup' ), 10, 3 );
@theeventscalendar
theeventscalendar / Hide end time
Created June 4, 2015 22:33
Hides event end times
// Function to hide end time in list, map, photo, and single event view
// NOTE: This will only hide the end time for events that end on the same day
add_filter( 'tribe_events_event_schedule_details_formatting', 'remove_end_time', 10, 2);
function remove_end_time( $formatting_details ) {
$formatting_details['show_end_time'] = 0;
return $formatting_details;
}
// Function to hide end time in Week and Month View Tooltips
@theeventscalendar
theeventscalendar / continual month pagination.php
Created June 4, 2015 22:31 — forked from barryhughes/continual-month-pagination.php
Let visitors page through all months (not just the populated date range)
/**
* Allows visitors to page forward/backwards in any direction within month view
* an "infinite" number of times (ie, outwith the populated range of months).
*/
class ContinualMonthViewPagination {
protected $tec;
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' ) );
@theeventscalendar
theeventscalendar / Filter for new slug names.php
Last active August 29, 2015 14:22 — forked from anonymous/filter-tec-month-list-url-links.php
Makes the calendar respect new slug names
/**
* @param string $url
* @param string $type
* @return string
*/
function modify_month_list_link_urls( $url, $type ) {
if ( 'month' === $type ) return str_replace( 'month', 'calendar', $url );
if ( 'list' === $type ) return str_replace( 'list', 'all-events', $url );
if ( 'photo' === $type ) return str_replace( 'photo', 'picture-board', $url );
return $url;
@theeventscalendar
theeventscalendar / Renaming view slugs.php
Last active March 28, 2016 17:34 — forked from anonymous/custom-view-slugs.php
Changes the names of the slugs used for events calendar views
<?php
/**
* Modify the "bases" used to form event URLs for various views.
*
* @param array $bases
*
* @return array
*/
function rename_event_view_slugs( $bases ) {
if ( isset( $bases['month'] ) ) $bases['month'] = [ 'calendar', 'calendar' ];
@theeventscalendar
theeventscalendar / Renaming calendar views.php
Last active February 22, 2016 23:11 — forked from anonymous/view-change-tec-391.php
Renames Calendar Views
// We want to adapt the names of views listed within the Tribe Events Bar
add_filter( 'tribe-events-bar-views', 'rename_tribe_views_in_selector', 100 );
function rename_tribe_views_in_selector( $views ) {
// This lists the original view names you wish to change along
// with the substitutes to wish to use in their place
$to_change = array(
'List' => 'All Events',
'Month' => 'Calendar',
'Photo' => 'Picture Board',
@theeventscalendar
theeventscalendar / Countdown Widget sample tweaks.css
Last active August 29, 2015 14:22 — forked from anonymous/countdown-widget-sample.css
Sample CSS tweaks for Events Calendar PRO's Countdown widget
/** Change the colour and other properties of the venue widget title */
.tribe-events-countdown-widget h2.widget-title {
color: #fa0;
transform: rotate( -2deg );
}
/** Make the event title uppercase and green */
.tribe-events-countdown-widget .tribe-countdown-text a {
color: #10c050;
text-transform: uppercase;
@theeventscalendar
theeventscalendar / Featured Venue Widget sample tweaks.css
Last active August 29, 2015 14:22 — forked from anonymous/sample-featured-venue.css
Sample CSS tweaks for Events Calendar PRO's Featured Venue widget
@theeventscalendar
theeventscalendar / PRO Calendar Widget grid section customizations.css
Last active August 29, 2015 14:22 — forked from anonymous/calendar-widget-grid-section-customizations.css
Sample CSS tweaks for Events Calendar PRO's Calendar widget
/** Change the background colour of the grid header area */
.tribe_mini_calendar_widget thead,
.tribe_mini_calendar_widget .tribe-mini-calendar-nav td {
background: lightblue;
}
/** Change the colour scheme of the days of the week */
.tribe_mini_calendar_widget .tribe-mini-calendar-dayofweek {
background: yellow;
color: black;
@theeventscalendar
theeventscalendar / PRO Calendar Widget sample tweaks.css
Last active August 29, 2015 14:22 — forked from anonymous/sample-calendar-widget-custom.css
Sample CSS tweaks for Events Calendar PRO's Calendar widget
/** Place a border around the entire widget */
.tribe_mini_calendar_widget {
border: 2px solid black;
}
/** Change the widget title colour and size */
.tribe_mini_calendar_widget h2.widget-title {
color: purple;
font-size: 30px;
}