Skip to content

Instantly share code, notes, and snippets.

@theeventscalendar
theeventscalendar / hide country from venue address
Created June 12, 2015 21:01 — forked from geoffgraham/gist:b73bae41a346c0fc5af6
Hide the country from your event venue's address
.tribe-events-meta-group dd.location span.country-name {
position: absolute;
top: -10000px;
visibility: hidden;
}
@theeventscalendar
theeventscalendar / functions.php
Last active May 17, 2016 03:18 — forked from ckpicker/gist:ba9b617afdbdb3867159
Change the word Event/Events globally on your calendar. This example uses Meeting/Meetings instead. Change the single and plural options below to whatever word you'd like to use.
<?php
// Singular
add_filter( 'tribe_event_label_singular', 'event_display_name' );
function event_display_name() {
return 'Meeting';
}
add_filter( 'tribe_event_label_singular_lowercase', 'event_display_name_lowercase' );
function event_display_name_lowercase() {
return 'meeting';
@theeventscalendar
theeventscalendar / conditional wrappers for views.php
Last active August 29, 2015 14:22 — forked from jo-snips/events-conditional-wrappers.php
Conditional wrappers for Event Views. See http://m.tri.be/18dv for details.
<?php
/*-----------------------------------------------------------------------------------*/
/* 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
@theeventscalendar
theeventscalendar / fast forward mini calendar.php
Last active August 29, 2015 14:22 — forked from elimn/tribe_advance_minical.php
Fast forward the PRO Mini Calendar Widget to the month with the next upcoming event
<?php
/**
* Tries to force the minicalendar widget to show the month of the next upcoming event by default, rather
* than simply showing the current month (which might be empty).
*/
class Tribe_Advance_Minical
{
protected $target_date = false;
/**
@theeventscalendar
theeventscalendar / exclude events category.php
Last active November 27, 2022 03:30 — forked from elimn/tribe_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');
@theeventscalendar
theeventscalendar / custom month navigation sample.php
Created June 5, 2015 23:02 — forked from anonymous/custom-month-nav-sample.php
This is an example of a customized month navigation with a Return to Current Month link added.
<?php
/**
* Month View Nav Template
* This file loads the month view navigation.
*
* Override this template in your own theme by creating a file at [your-theme]/tribe-events/month/nav.php
*
* @package TribeEventsCalendar
*
*/
@theeventscalendar
theeventscalendar / back to current month.php
Created June 5, 2015 23:01 — forked from elimn/back-to-current-month.php
Adds a Back to Current Month link at the bottom of the calendar
<?php if ( date_i18n( 'Y-m-01' ) !== tribe_get_month_view_date() ) : ?>
<li class="tribe-events-nav-current">
<a href="<?php echo Tribe__Events__Main::instance()->getLink( 'month' ) ?>">Back to Current Month</a>
</li>
<?php endif ?>
<ul class="tribe-events-sub-nav">
<li class="tribe-events-nav-previous">
<?php tribe_events_the_previous_month_link(); ?>
</li>
<!-- .tribe-events-nav-previous -->
<li class="tribe-events-nav-next">
<?php tribe_events_the_next_month_link(); ?>
</li>
<!-- .tribe-events-nav-next -->
@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 / thumbnails in List Widget
Created June 4, 2015 22:38 — forked from ckpicker/gist:a754cbffa3c37b4a8c30
Add thumbnail images to the Upcoming Events List Widget
function custom_widget_featured_image() {
global $post;
echo tribe_event_featured_image( $post->ID, 'thumbnail' );
}
add_action( 'tribe_events_list_widget_before_the_event_title', 'custom_widget_featured_image' );