Skip to content

Instantly share code, notes, and snippets.

jQuery(document).ready(function ($) {
function updateFestivalTitle() {
let titleEl = $("#tribe-events-dynamic-title");
if (!titleEl.length) return;
let params = new URLSearchParams(window.location.search);
let termId = params.get(pfFestivalData.taxonomyParam + "[0]");
if (termId) {
if (
<?php
/* -------------------------------------------------------------------------------
// Display the custom taxonomy term title above events list on initial load.
------------------------------------------------------------------------------- */
add_action('wp_enqueue_scripts', function () {
if (! function_exists('tribe_is_event_query') || ! tribe_is_event_query()) {
return;
}
<?php
/**
* View Component: Header Title
*
* Override this template in your own theme by creating a file at:
* [your-theme]/tribe/events/v2/components/header-title.php
*
* See more documentation about our views templating system.
*
<?php
if ('event_festival' === $taxonomy) {
$url = home_url('/') . 'events/list/?tribe_filterbar_eventfestival[0]=' . $term->term_id;
}
@chugs
chugs / EventFestival.php
Created August 16, 2025 05:49
TEC - Add custom taxonomy to filter
<?php
use Tribe\Events\Filterbar\Views\V2\Filters\Context_Filter;
class EventFestival extends \Tribe__Events__Filterbar__Filter
{
// Use the trait required for filters to correctly work with Views V2 code.
use Context_Filter;
public $type = 'select';
@chugs
chugs / tribe-ext-custom-filter.php
Last active August 20, 2025 09:01
TEC - Add custom taxonomy to filterbar
<?php
/**
* Plugin Name: Filter Bar Extension: Custom Time-of-Day Filter
* Plugin URI: https://theeventscalendar.com/extensions/creating-a-custom-filter-for-filter-bar/
* GitHub Plugin URI: https://github.com/mt-support/tribe-ext-custom-filter
* Description: Create a custom filter for Filter Bar that narrows down displayed events by time of day.
* Version: 1.0.1
* Extension Class: Tribe\Extensions\Custom_Filter\Main
* Author: The Events Calendar
@chugs
chugs / tec-custom-search.php
Last active December 11, 2018 03:13
Extend The Events Calendar search to include custom fields
/**
* Extend The Events Calendar search to include custom fields
*
* Reference - Extend WordPress search to include custom fields
* http://adambalee.com/search-wordpress-by-custom-fields-without-a-plugin/
*
* Reference - https://theeventscalendar.com/support/forums/topic/how-to-include-custom-fields-in-search/
*/
/**
function _remove_script_version( $src ){
$parts = explode( '?', $src );
return $parts[0];
}
add_filter( 'script_loader_src', '_remove_script_version', 15, 1 );
add_filter( 'style_loader_src', '_remove_script_version', 15, 1 );