This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Randomize Future Events on Main Loop of Site for The Events Calendar | |
* Setting needs to be checked to show Events on Main Loop in the Events Calendar Settings | |
* @3.7 | |
*/ | |
add_action( 'pre_get_posts', 'random_posts' ); | |
function random_posts( $query ) { | |
if ( $query->is_home() && $query->is_main_query() ) { | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Filter ical Description for Events Calendar 3.7 | |
* Removes tags and most shortcodes for single event only | |
* | |
*/ | |
add_filter('tribe_ical_feed_item','filter_ical_description', 10, 2); | |
function filter_ical_description($item, $eventPost) { | |
$description = preg_replace( "/[\n\t\r]/", ' ', strip_tags( strip_shortcodes( $eventPost->post_content ) ) ); | |
$description = preg_replace ("/\[(\S+)\]/e", "", $description); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Get Terms of Current Event and Display in a List without links | |
$terms = wp_get_post_terms(get_the_id(), 'tribe_events_cat', array("fields" => "all")); | |
if ( !empty( $terms ) && !is_wp_error( $terms ) ){ | |
echo "<ul>"; | |
foreach ( $terms as $term ) { | |
echo "<li>" . $term->name . "</li>"; | |
} | |
echo "</ul>"; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* The Events Calendar Filter for RSS Feed to Correct Pubdate | |
* Modifys the first $zone check as UTC time 0 was registering as === false | |
*/ | |
add_filter( 'get_post_time', 'events_rss2_gmt_pubdate_correction', 20 , 3 ); | |
function events_rss2_gmt_pubdate_correction($time, $d, $gmt) { | |
global $post; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Remove Please log in first. From Events Calendar Community Add On Login | |
* @version 3.8 | |
* | |
*/ | |
function filter_translations($translations, $text, $domain) { | |
if ($domain == 'tribe-events-community') { | |
$text = str_ireplace( 'Please log in first.', '', $text ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* The Events Calendar 3.8 Filter the Page Title when a date is selected the event bar | |
* @$title | |
* | |
*/ | |
function filter_upcoming_events_title($title) { | |
if (tribe_is_list_view() || tribe_is_month()) { | |
if (strpos($title,'Events for') !== false && !tribe_is_past()) { | |
$title = "Upcoming Events"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Exclude Categories from Month View of the Events Calendar | |
* Change 'Concert','Convention' to your Event Category Names to work | |
*/ | |
add_action( 'pre_get_posts', 'exclude_events_category' ); | |
function exclude_events_category( $query ) { | |
if ( tribe_is_month() && !is_tax() ) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Change text Near on the Events Calendar Search Bar | |
* | |
*/ | |
add_filter('tribe-events-bar-filters', 'ecp_theme_filter_text', 10, 3); | |
function ecp_theme_filter_text( $tribebar ) { | |
$tribebar['tribe-bar-geoloc']['caption'] = "Custom"; | |
return $tribebar; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* 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); | |
OlderNewer