Advertisement
BakerMan

WPSEO Title Category Fix TEC 2.0.11

Apr 7th, 2013
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.89 KB | None | 0 0
  1. /**
  2.  * Small adjustment from alonso's code posted in
  3.  * http://tri.be/support/forums/topic/title-again/
  4.  * (adds pagination to category pages)
  5.  */
  6. function my_custom_titles($title) {
  7.     // Find the page number (if the results are paginated/we've passed page 1
  8.     global $paged;
  9.     $pagenum = (is_int($paged) and $paged > 1) ? (string) $paged : '';
  10.  
  11.     if( tribe_is_month() && !is_tax() ) { // The Main Calendar Page
  12.         return 'Events Calendar';
  13.     } elseif( tribe_is_month() && is_tax() ) { // Calendar Category Pages
  14.         return 'Events Calendar' . ' » ' . single_term_title('', false) . " (page $paged)";
  15.     } elseif( tribe_is_event() && !tribe_is_day() && !is_single() ) { // The Main Events List
  16.         return  single_term_title('', false) .  'Termine';
  17.     } elseif( tribe_is_venue() ) { // Single Venues
  18.         return $title;
  19.     } else {
  20.         return $title;
  21.     }
  22. }
  23.  
  24. add_filter('wpseo_title','my_custom_titles');
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement