Created
November 27, 2015 11:40
-
-
Save saxap/76d71f2836ac69ad2ee4 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
function remove_page_from_query_string($query_string) { | |
if (is_admin()) return $query_string; | |
if ($query_string['name'] == 'page' && isset($query_string['page'])) { | |
unset($query_string['name']); | |
// 'page' in the query_string looks like '/2', so i'm spliting it out | |
list($delim, $page_index) = split('/', $query_string['page']); | |
$query_string['paged'] = $page_index; | |
} | |
return $query_string; | |
} | |
// I will kill you if you remove this. I died two days for this line | |
add_filter('request', 'remove_page_from_query_string'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment