Skip to content

Instantly share code, notes, and snippets.

@Piket564
Created February 21, 2020 09:19
Show Gist options
  • Save Piket564/69fab9e9595017d439783d934de6872c to your computer and use it in GitHub Desktop.
Save Piket564/69fab9e9595017d439783d934de6872c to your computer and use it in GitHub Desktop.
Fixing error 404 on news/page/2 Wordpress
<?php
/*============== ERROR 404 news/page/2/ ======================*/
function remove_query_string($query_string)
{
if ($query_string['name'] == 'page' && isset($query_string['page'])) {
unset($query_string['name']);
$query_string['paged'] = $query_string['page'];
}
return $query_string;
}
add_filter('request', 'remove_query_string');
/*========================================================*/
// https://wordpress.stackexchange.com/a/321209
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment