brook-tribe

Change <title> values

Jan 31st, 2014
1,838
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // Runs the <title> element through our custom filter
  2. add_filter('tribe_events_title_tag', 'filter_events_title');
  3. // If you are using certain versions of Yoast you might try deleting the above line and uncommenting the following one
  4. // add_filter('wpseo_title', 'filter_events_title');
  5.  
  6. // Tribe events: Manually set title for each page
  7. function filter_events_title ($title) {
  8.  
  9.     if ( tribe_is_event() && is_single() ) { // Single Events
  10.         $title = 'Single event page';
  11.     }
  12.     elseif ( tribe_is_venue() ) { // Single Venues
  13.         $title = 'Venue page';
  14.     }
  15.     elseif (tribe_is_organizer() && is_single() ) { // Single Organizers
  16.         $title = 'Organizer page';
  17.     }
  18.     elseif ( tribe_is_month() && !is_tax() ) {  // Month View Page
  19.         $title = 'Month view page';
  20.     }
  21.     elseif ( tribe_is_month() && is_tax() ) { // Month View Category Page
  22.         $title = 'Month view category page';
  23.     }
  24.     elseif ( tribe_is_upcoming() && !is_tax() ) { // List View Page: Upcoming Events
  25.         $title = 'List view: Upcoming events page';
  26.     }
  27.     elseif ( tribe_is_upcoming() && is_tax() ) { // List View Category Page: Upcoming Events
  28.         $title = 'List view Category: Upcoming events page';
  29.     }
  30.     elseif ( tribe_is_past() && !is_tax() ) { // List View Page: Past Events
  31.         $title = 'List view: Past events page';
  32.     }
  33.     elseif ( tribe_is_past() && is_tax() ) { // List View Category Page: Past Events
  34.         $title = 'List view Category: Past events page';
  35.     }
  36.     elseif ( tribe_is_week() && !is_tax() ) { // Week View Page
  37.         $title = 'Week view page';
  38.     }
  39.     elseif ( tribe_is_week() && is_tax() ) { // Week View Category Page
  40.         $title = 'Week view category page';
  41.     }
  42.     elseif ( tribe_is_day() && !is_tax() ) { // Day View Page
  43.         $title = 'Day view page';
  44.     }
  45.     elseif ( tribe_is_day() && is_tax() ) { // Day View Category Page
  46.         $title = 'Day view category page';
  47.     }
  48.     elseif ( tribe_is_map() && !is_tax() ) { // Map View Page
  49.         $title = 'Map view page';
  50.     }
  51.     elseif ( tribe_is_map() && is_tax() ) { // Map View Category Page
  52.         $title = 'Map view category page';
  53.     }
  54.     elseif ( tribe_is_photo() && !is_tax() ) { // Photo View Page
  55.         $title = 'Photo view page';
  56.     }
  57.     elseif ( tribe_is_photo() && is_tax() ) { // Photo View Category Page
  58.         $title = 'Photo view category page';
  59.     }
  60.  
  61.     return $title;
  62. }
RAW Paste Data