Created
November 27, 2012 14:39
-
-
Save jo-snips/4154553 to your computer and use it in GitHub Desktop.
The Events Calendar: Custom Title Tag (wp_title) Filter
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| add_filter('wp_title', 'custom_seo_title'); | |
| function custom_seo_title($title) { | |
| if( tribe_is_month() && !is_tax() ) { // The Main Calendar Page | |
| $title = 'Events Calendar'; | |
| } elseif( tribe_is_month() && is_tax() ) { // Calendar Category Pages | |
| $title = 'Events Calendar' . ' » ' . single_term_title('', false); | |
| } elseif( tribe_is_event() && !tribe_is_day() && !is_single() ) { // The Main Events List | |
| $title = 'Events List'; | |
| } elseif( tribe_is_event() && is_single() ) { // Single Events | |
| $title = get_the_title(); | |
| } elseif( tribe_is_day() ) { // Single Event Days | |
| $title = 'Events on: ' . date('F j, Y', strtotime($wp_query->query_vars['eventDate'])); | |
| } elseif( tribe_is_venue() ) { // Single Venues | |
| $title = get_the_title(); | |
| } else { | |
| $title = get_the_title(); | |
| } | |
| return $title; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment