Skip to content

Instantly share code, notes, and snippets.

@saxap
Created November 27, 2015 11:40
Show Gist options
  • Save saxap/76d71f2836ac69ad2ee4 to your computer and use it in GitHub Desktop.
Save saxap/76d71f2836ac69ad2ee4 to your computer and use it in GitHub Desktop.
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