Created
October 28, 2016 22:36
-
-
Save GeoffEW/ad2d0879e2daec631074e2e15c0a9852 to your computer and use it in GitHub Desktop.
Allows mobile view default setting to work alongside Yoast SEO
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_filter( 'wpseo_canonical', function( $canonical_url ) { | |
global $wp_query; | |
return ! empty( $wp_query->tribe_is_event_query ) && wp_is_mobile() | |
? Tribe__Events__Main::instance()->getLink( tribe_get_mobile_default_view() ) | |
: $canonical_url; | |
} ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment