Created
December 16, 2015 09:32
-
-
Save saxap/4010edde1c6fc9c9b3b2 to your computer and use it in GitHub Desktop.
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
// yoast rel fixes | |
add_filter( 'wpseo_prev_rel_link', 'hide_it'); | |
add_filter( 'wpseo_next_rel_link', 'hide_it'); | |
function hide_it($str) { | |
if (is_home() || is_post_type_archive('services') || is_post_type_archive('reviews') || is_post_type_archive('contacts')) { | |
return false; | |
} else { | |
$search = array( | |
'pressroom/news/', | |
'pressroom/articles/' | |
); | |
$replace = array( | |
'news/', | |
'articles/' | |
); | |
$str = str_replace($search, $replace, $str); | |
return $str; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment