Advertisement
BakerMan

Custom event category page titles sample

Aug 28th, 2013
119
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.57 KB | None | 0 0
  1. add_filter('the_title', 'change_event_category_title', 10, 2);
  2.  
  3. /**
  4.  * Note - deliberately not using tribe_is_event_category() with TEC 3.0.3 as it can return
  5.  * true even if no particular category has been selected.
  6.  */
  7. function change_event_category_title($title, $id) {
  8.     if (-9999 !== $id || !tribe_is_event_query()) return $title; // Leave non-Tribe pages untouched
  9.     if (!$GLOBALS['wp_query']->tribe_is_event_category) return $title; // We're only interested in archives
  10.     return 'Custom Event Archive Title'; // Build your custom title (perhaps manipulate $title)
  11. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement