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
<?php | |
// Fix blurry photo image #jrfm | |
// To use in functions.php without the PHP opening tag at the top :-) | |
function tribe_adjust_photo_view_image_size($unfiltered) { | |
if ( tribe_is_photo() ) { | |
$filtered = get_the_post_thumbnail( get_the_ID(), 'full' ); |
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
<?php | |
/* Add this code within the single-event.php template */ | |
if ( function_exists( 'cwd_display_recurring_events' ) ) { | |
global $post; | |
echo cwd_display_recurring_events( $post ); | |
} | |
function cwd_display_recurring_events( $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
<?php | |
/** | |
* Retrieves the next upcoming recurrence for a given post ID | |
* | |
* @param int $event_id The post ID for the event | |
* | |
* @return WP_Post|null The event post object, or null if nothing was found | |
*/ | |
function tribe_get_next_upcoming_recurrence( $event_id ) { |
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
<?php | |
/* Tribe, remove tickets form for recurring instances other than the first */ | |
function tribe_remove_tickets_from_recurring_instances ( ) { | |
global $post; | |
// bail if The Events Calendar or Event Tickets Plus are not active | |
if ( !class_exists( 'Tribe__Events__Main' ) || !class_exists('Tribe__Tickets_Plus__Commerce__WooCommerce__Main') ) return false; |
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
<?php | |
<?php | |
/** | |
* Single Event Meta (Details) Template | |
* | |
* Override this template in your own theme by creating a file at: | |
* [your-theme]/tribe-events/modules/meta/details.php | |
* | |
* @package TribeEventsCalendar | |
*/ |
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
<?php | |
/** | |
* Hides cost from the single event details section | |
* | |
* @param string $tpl Template relative path | |
*/ | |
function tribe_single_hide_cost( $tpl ) { | |
if ( 'modules/meta/details.php' === $tpl ) { | |
add_filter( 'tribe_get_formatted_cost', '__return_empty_string' ); |
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
<?php | |
/* Additional functions for changing strings in the events calendar and its plugins | |
* See https://theeventscalendar.com/knowledgebase/change-the-wording-of-any-bit-of-text-or-string/ for details | |
* on the provided functions by the TEC team | |
* 1. - function for changing quantity based spelling | |
* 2. - function for changing strings with an attached context | |
*/ | |
function tribe_custom_theme_numbered_text ( $translation, $single, $plural, $number, $domain ) { |
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
<?php add_filter ( 'tribe_get_cost', 'tribe_not_show_free', 10, 3 ); | |
function tribe_not_show_free ( $cost, $post_id, $with_currency_symbol ) { | |
if ( $cost == 0 || $cost == 'Free' ) { | |
$cost = str_replace('Free', '', $cost); | |
$cost = str_replace(' - ', '', $cost); | |
} | |
return $cost; | |
} |
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
<?php | |
/* Tribe, hide cost for recurring instances other than the first */ | |
function tribe_hide_cost_for_recurring_instances ( $cost, $post_id, $with_currency_symbol ) { | |
$event = tribe_events_get_event( $post_id ); | |
if ( $event->post_parent > 0 ) { | |
$cost = ''; | |
} |
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
<?php | |
/* Tribe, remove child recurring events from photo view */ | |
function tribe_set_default_date ( $query ) { | |
if ( tribe_is_photo() ) { | |
$query->set( 'post_parent', '0' ); | |
} | |
} | |
add_action( 'pre_get_posts', 'tribe_set_default_date', 15 ); |