Created
February 21, 2020 09:19
-
-
Save Piket564/69fab9e9595017d439783d934de6872c to your computer and use it in GitHub Desktop.
Fixing error 404 on news/page/2 Wordpress
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 | |
/*============== 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