Skip to content

Instantly share code, notes, and snippets.

@geoffgraham
geoffgraham / gist:b73bae41a346c0fc5af6
Created October 21, 2014 22:26
The Events Calendar - Hide country field from a single event meta box
.tribe-events-meta-group dd.location span.country-name {
position: absolute;
top: -10000px;
visibility: hidden;
}
@geoffgraham
geoffgraham / gist:d9f4428d09f70daa2ff4
Last active August 29, 2015 14:08
The Events Calendar - Order Events by Modified Date when on Home
add_action( 'pre_get_posts', 'order_by_modified' );
function order_by_modified( $query ) {
if ( $query->is_home() && $query->is_main_query() ) {
$query->set( 'orderby', 'modified' );
}
}
@geoffgraham
geoffgraham / gist:a2f313966fba362aa066
Created October 28, 2014 21:15
Events Calendar 3.8.1 // Hook into 'tribe_events_inside_before_loop' action to display custom text for list view
add_action( 'tribe_events_inside_before_loop', 'output_custom_code' );
function output_custom_code() {
// Check if displaying month view
if( tribe_is_month() ) {
echo 'Your custom code to display.';
}
}
@geoffgraham
geoffgraham / gist:b43b23c9ac13a575a8da
Created October 31, 2014 17:17
Foursquare // Chaplains Form HTML
<form method="post" action="https://secure-q.net/Pages/Post" enctype="application/x-www-form-urlencoded" >
<input type="hidden" id="merchantid" name="merchantid" value="ICFGCQ" />
<input type="hidden" id="pageid" name="pageid" value="4504" />
<input type="hidden" id="Organization" name="Organization" value="" />
<input type="hidden" id="Prefix" name="Prefix" value="" />
<input type="hidden" id="FirstName" name="FirstName" value="" />
<input type="hidden" id="LastName" name="LastName" value="" />
<input type="hidden" id="Suffix" name="Suffix" value="" />
<input type="hidden" id="Address1" name="Address1" value="" />
<input type="hidden" id="City" name="City" value="" />
@geoffgraham
geoffgraham / gist:9e34a00495624ab38f41
Created October 31, 2014 17:18
Foursquare // Disaster Relief Form HTML
<form method="post" action="https://secure-q.net/Pages/Post" enctype="application/x-www-form-urlencoded" >
<input type="hidden" id="merchantid" name="merchantid" value="ICFGCQ" />
<input type="hidden" id="pageid" name="pageid" value="4150" />
<input type="hidden" id="Organization" name="Organization" value="" />
<input type="hidden" id="Prefix" name="Prefix" value="" />
<input type="hidden" id="FirstName" name="FirstName" value="" />
<input type="hidden" id="LastName" name="LastName" value="" />
<input type="hidden" id="Suffix" name="Suffix" value="" />
<input type="hidden" id="Address1" name="Address1" value="" />
<input type="hidden" id="City" name="City" value="" />
@geoffgraham
geoffgraham / gist:8914945df50ec87bf25c
Last active August 29, 2015 14:08
Modern Tribe // Change "Organizer" label to something else
add_filter('gettext', 'theme_filter_text', 10, 3);
function theme_filter_text( $translations, $text, $domain ) {
// Copy and modify the following if {} statement to replace multiple blocks of text
// Match the text you want you want to translate, preferably also match the text domain
if($text === 'Organizer' && $domain === 'tribe-events-calendar') {
// The custom text you want instead
$text = 'Instructor';
@geoffgraham
geoffgraham / gist:60c83168e2a904b882fc
Created November 5, 2014 00:19
Events Calendar 3.8 // Remove Page Heading from Month View
add_filter('tribe_get_events_title', 'change_month_view_events_title');
function change_upcoming_events_title($title) {
//We'll change the title on upcoming and map views
if (tribe_is_month()) return '';
//In all other circumstances, leave the original title in place
return $title;
}
@geoffgraham
geoffgraham / gist:167316c748ea59ce86fb
Created November 25, 2014 19:51
Events Calendar 3.8 // Translate Additional Fields header to something else
add_filter('gettext', 'theme_filter_text', 10, 3);
function theme_filter_text( $translations, $text, $domain ) {
// If this text domain starts with "tribe-"
if(strpos($domain, 'tribe-') === 0) {
// The text to replace
$text = str_replace(
// Text to search for
array('Other'),
@geoffgraham
geoffgraham / gist:9c61b6b86e8b843cd04e
Created December 3, 2014 15:02
Events Calendar // Default Event Template Override
<?php
/**
* Default Events Template
* This file is the basic wrapper template for all the views if ‘Default Events Template’
* is selected in Events -> Settings -> Template -> Events Template.
*
* Override this template in your own theme by creating a file at [your-theme]/tribe-events/default-template.php
*
* @package TribeEventsCalendar
*
@geoffgraham
geoffgraham / gist:a973d776a97f4de3ab5a
Created December 3, 2014 20:36
Events Calendar 3.8 // Change Page Title for List Views
// Runs the <title> element through our custom filter
add_filter('tribe_events_title_tag', 'filter_events_title');
// If you are using certain versions of Yoast you might try deleting the above line and uncommenting the following one
// add_filter('wpseo_title', 'filter_events_title');
// Tribe events: Manually set title for each page
function filter_events_title ($title) {
if ( tribe_is_upcoming() && !is_tax() ) { // List View Page: Upcoming Events