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_events_views_v2_view_breakpoints', function( $breakpoints, $view ) { | |
return [ | |
//change the following values to the desired ones | |
'xsmall' => 500, | |
'medium' => 768, | |
'full' => 960, | |
]; | |
}, 10, 2 ); |
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 | |
/* | |
* Alters event's archive titles | |
*/ | |
function tribe_alter_event_archive_titles ( $original_recipe_title, $depth ) { | |
// Modify the titles here | |
// Some of these include %1$s and %2$s, these will be replaced with relevant dates | |
$title_upcoming = 'Upcoming Events'; // List View: 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
<?php | |
/** | |
* This will enable the cost field for Eventbrite imported events in the admin | |
* Add this code to your active theme's functions.php file | |
* Important Note: No cost will be displayed for Eventbrite events if none is manually set. | |
*/ | |
if ( class_exists( 'Tribe__Events__Tickets__Eventbrite__Main' ) ) { |
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 | |
/* Force the use of the cost field of event and ignore tickets price */ | |
function tribe_just_show_price_field ( $cost, $post_id, $with_currency_symbol ) { | |
$cost_utils = tribe( 'tec.cost-utils' ); | |
$cost = tribe_get_event_meta( $post_id, '_EventCost' ); | |
if ( $with_currency_symbol ) { | |
$cost = $cost_utils->maybe_format_with_currency( $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 | |
/** | |
* Enable author support for organizer posts. | |
* | |
* @param array $args | |
* @return array | |
*/ | |
function tribe_organizers_author_support( $args ) { | |
$args['supports'][] = 'author'; | |
return $args; |
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 | |
/** | |
* Single Event Template for Widgets | |
* | |
* This template is used to render single events for both the calendar and advanced | |
* list widgets, facilitating a common appearance for each as standard. | |
* | |
* You can override this template in your own theme by creating a file at | |
* [your-theme]/tribe-events/pro/widgets/modules/single-event.php | |
* |
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 | |
function register_my_menu() { | |
register_nav_menu( 'main-events', __( 'Main Events Categories' ) ); | |
} | |
add_action( 'init', 'register_my_menu' ); | |
add_action( 'tribe_events_before_template', 'main_events_custom_menu' ); | |
function main_events_custom_menu () { | |
wp_nav_menu( array( 'theme_location' => 'main-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
<?php | |
// Do not show "iCal Export" link | |
add_filter( 'tribe_events_list_show_ical_link', '__return_false' ); | |
// Add custom "iCal Export" link | |
add_action( 'tribe_events_after_footer', 'custom_events_ical_link', 20, 1 ); | |
/** | |
* Generates the markup for the "iCal Export" link for the views. | |
*/ |
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 | |
/** | |
* Customize The Events Calendar iCal links to add a rel="nofollow" attribute to the links for SEO purposes | |
*/ | |
add_filter( 'tribe_events_ical_single_event_links', 'my_custom_events_ical_single_event_links' ); | |
function my_custom_events_ical_single_event_links( $calendar_links ) { | |
$calendar_links = '<div class="tribe-events-cal-links">'; | |
$calendar_links .= '<a class="tribe-events-gcal tribe-events-button" rel="nofollow" href="' . Tribe__Events__Main::instance()->esc_gcal_url( tribe_get_gcal_link() ) . '" title="' . esc_attr__( 'Add to Google Calendar', 'the-events-calendar' ) . '">+ ' . esc_html__( 'Google Calendar', 'the-events-calendar' ) . '</a>'; | |
$calendar_links .= '<a class="tribe-events-ical tribe-events-button" rel="nofollow" href="' . esc_url( tribe_get_single_ical_link() ) . '" title="' . esc_attr__( 'Download .ics file', 'the-events-calendar' ) . '" >+ ' . esc_html__( 'iCal Export', 'the-events-calendar' ) . '</a>'; |
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 | |
/** | |
* For ticketed events, it filter the event cost to only consider ticket price if on sale. | |
* | |
* From: https://gist.github.com/vicskf/e9f4763809d825a2b768fe83a945c2fd | |
*/ | |
add_filter( 'tribe_get_cost', 'custom_tribe_get_cost', 10, 3 ); | |
function custom_tribe_get_cost ( $cost, $post_id, $with_currency_symbol ) { |
NewerOlder