Created
October 18, 2019 17:20
-
-
Save timersys/b630dc0e97791499f6f08ce0a4de9cf1 to your computer and use it in GitHub Desktop.
Cancel post geotargeting on certain 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 | |
// cancel geotargeted posts on certain pages | |
add_filter('geot/cancel_posts_where', 'geotwp_cancel_geo' ); | |
function geotwp_cancel_geo( $query ) { | |
// cancel for every page that is not search | |
if( ! is_page('search') ) { | |
return true; | |
} | |
return false; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment