From d40e12b75026b6be503cb3fd58ad8526a7c7c92a Mon Sep 17 00:00:00 2001 From: Matt Mullenweg Date: Tue, 23 Aug 2005 07:43:11 +0000 Subject: [PATCH] Fixes #1357 git-svn-id: https://develop.svn.wordpress.org/trunk@2803 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-includes/template-functions-links.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/wp-includes/template-functions-links.php b/wp-includes/template-functions-links.php index 6e29a1fbde..b4e3493718 100644 --- a/wp-includes/template-functions-links.php +++ b/wp-includes/template-functions-links.php @@ -409,7 +409,14 @@ function get_pagenum_link($pagenum = 1) { $qstr = preg_replace('|^/+|', '', $qstr); if ($permalink) $qstr = trailingslashit($qstr); - return preg_replace('/&([^#])(?![a-z]{1,8};)/', '&$1', trailingslashit( get_settings('home') ) . $qstr ); + $qstr = preg_replace('/&([^#])(?![a-z]{1,8};)/', '&$1', trailingslashit( get_settings('home') ) . $qstr ); + + // showing /page/1/ or ?paged=1 is redundant + if ($pagenum === 1) { + $qstr = str_replace('page/1/', '', $qstr); // for mod_rewrite style + $qstr = remove_query_arg('paged', $qstr); // for query style + } + return $qstr; } function next_posts($max_page = 0) { // original by cfactor at cooltux.org