Hello,
Our events are divided in 2 types. We created these types as Event Tags.
So we have 2 mainly urls:
– Events type 1: site.com/events/?tribe_event_display=list&tribe_tags=137
– Events Type 2: site.com/events/?tribe_event_display=list&tribe_tags=138
How to change the title “Upcoming Events” depends of Event Type?
Actually I did it with this jQuery:
jQuery( document ).ready(function() {
var actualUrl = window.location.href.toLowerCase();
if (actualUrl.indexOf("/events/") > -1) {
var eventType = getUrlParameter("tribe_tags");
var newTitle = "" ;
if (eventType=="137") {
newTitle = "Events Type 1" ;
};
if (eventType=="138") {
newTitle = "Events Type 1" ;
};
if (newTitle!="") {
jQuery( "h2.tribe-events-page-title" ).text(newTitle);
};
};
This code works OK when the events page is loaded, but when we click into “Next Events »” link or the previous one, we lose the new title. Its because the next events are loaded via Ajax, so our code isn’t load again.
Any idea to do it?
Thanks