Skip to content

Instantly share code, notes, and snippets.

@chugs
Created August 20, 2025 08:47
Show Gist options
  • Save chugs/f7bc5b8fe7336b8aaadf267a94ac36d0 to your computer and use it in GitHub Desktop.
Save chugs/f7bc5b8fe7336b8aaadf267a94ac36d0 to your computer and use it in GitHub Desktop.
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 (
pfFestivalData.festivalName &&
pfFestivalData.festivalName.length > 0
) {
titleEl.text("Events – " + pfFestivalData.festivalName);
}
} else {
titleEl.text("Events");
}
}
// Run on initial page load
updateFestivalTitle();
// Run after AJAX loads a new view
$(document).on("tribe_events_after_ajax", function () {
updateFestivalTitle();
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment