Skip to content

Instantly share code, notes, and snippets.

@saxap
Created December 16, 2015 09:32
Show Gist options
  • Save saxap/4010edde1c6fc9c9b3b2 to your computer and use it in GitHub Desktop.
Save saxap/4010edde1c6fc9c9b3b2 to your computer and use it in GitHub Desktop.
// 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