Skip to content

Instantly share code, notes, and snippets.

@theeventscalendar
theeventscalendar / bread crumbs for events and venues
Created June 4, 2015 22:39 — forked from ckpicker/gist:6875eb645a28df2a6db2
Adds bread crumb link support for events and venues in The Events Calendar
// Check if page is direct child
function is_child( $page_id ) {
global $post;
if( is_page() && ($post->post_parent != '') ) {
return true;
} else {
return false;
}
}
@theeventscalendar
theeventscalendar / Event Website button
Last active August 29, 2015 14:22 — forked from geoffgraham/gist:354ea76430319568cf06
Displays a link to your Event Website as a button
add_filter('tribe_get_event_website_link_label', 'tribe_get_event_website_link_label_default');
function tribe_get_event_website_link_label_default ($label) {
if( $label == tribe_get_event_website_url() ) {
$label = "Visit Website »";
$class = "my-button-class";
}
return '<a class="' . $class . '" href="' . tribe_get_event_website_url() . '">' . $label . ' </a>';
}
@theeventscalendar
theeventscalendar / List Widget sample tweaks.css
Last active August 29, 2015 14:22 — forked from anonymous/sample-css-tweaks-list-widget.css
Sample CSS tweaks for The Events Calendar List Widget
/** Change the size and colour of the widget title */
.tribe-events-list-widget h2.widget-title {
color: blue;
font-size: 30px;
}
/** Make each event standout with a new background and border */
.tribe-events-list-widget li.tribe-events-list-widget-events {
background: yellow;
border: 1px solid red;
@theeventscalendar
theeventscalendar / PRO List Widget sample tweaks.css
Last active August 29, 2015 14:22 — forked from anonymous/sample-advanced-list-widget-style-changes.css
Sample CSS tweaks for Events Calendar PRO's Advanced List Widget
/** Place a border around the entire widget */
.tribe-events-adv-list-widget {
border: 2px solid black;
}
/** Change the widget title colour and size */
.tribe-events-adv-list-widget h2.widget-title {
color: purple;
font-size: 30px;
}
@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;
}
@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 / 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 / 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 / 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;