Last active
December 23, 2015 06:59
-
-
Save jazbek/6597658 to your computer and use it in GitHub Desktop.
Fix for events taking over the page title on non-event pages
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
| <?php | |
| add_action( 'pre_get_posts', 'tribe_fix_title' ); | |
| function tribe_fix_title( $query ) { | |
| if ( $query->is_main_query() ) { | |
| if ( ! $query->tribe_is_event_query ) { | |
| $tec = TribeEvents::instance(); | |
| remove_filter( 'wp_title', array( $tec, 'maybeAddEventTitle' ), 10, 2 ); | |
| } | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment