diff --git a/wp-includes/post-template.php b/wp-includes/post-template.php index aea7be3f71..cd5fa5cb8a 100644 --- a/wp-includes/post-template.php +++ b/wp-includes/post-template.php @@ -587,7 +587,9 @@ function wp_link_pages($args = '') { $output .= ''; } else { if ( '' == get_option('permalink_structure') || in_array($post->post_status, array('draft', 'pending')) ) - $output .= ''; + $output .= ''; + elseif ( 'page' == get_option('show_on_front') && get_option('page_on_front') == $post->ID ) + $output .= ''; else $output .= ''; } @@ -606,24 +608,30 @@ function wp_link_pages($args = '') { $i = $page - 1; if ( $i && $more ) { if ( 1 == $i ) { - $output .= '' . $link_before. $previouspagelink . $link_after . ''; + $output .= ''; } else { if ( '' == get_option('permalink_structure') || in_array($post->post_status, array('draft', 'pending')) ) - $output .= '' . $link_before. $previouspagelink . $link_after . ''; + $output .= ''; + elseif ( 'page' == get_option('show_on_front') && get_option('page_on_front') == $post->ID ) + $output .= ''; else - $output .= '' . $link_before. $previouspagelink . $link_after . ''; + $output .= ''; } + $output .= $link_before. $previouspagelink . $link_after . ''; } $i = $page + 1; if ( $i <= $numpages && $more ) { if ( 1 == $i ) { - $output .= '' . $link_before. $nextpagelink . $link_after . ''; + $output .= ''; } else { if ( '' == get_option('permalink_structure') || in_array($post->post_status, array('draft', 'pending')) ) - $output .= '' . $link_before. $nextpagelink . $link_after . ''; + $output .= ''; + elseif ( 'page' == get_option('show_on_front') && get_option('page_on_front') == $post->ID ) + $output .= ''; else - $output .= '' . $link_before. $nextpagelink . $link_after . ''; + $output .= ''; } + $output .= $link_before. $nextpagelink . $link_after . ''; } $output .= $after; } diff --git a/wp-includes/query.php b/wp-includes/query.php index 52165f4ee9..88db3e116a 100644 --- a/wp-includes/query.php +++ b/wp-includes/query.php @@ -1480,11 +1480,18 @@ class WP_Query { ( empty($this->query) || !empty($qv['preview']) || - !empty($qv['cpage']) + !empty($qv['cpage']) || + !empty($qv['page']) || + !empty($qv['paged']) ) ) { $this->is_page = true; $this->is_home = false; $qv['page_id'] = get_option('page_on_front'); + // Correct for page_on_front + if ( !empty($qv['paged']) ) { + $qv['page'] = $qv['paged']; + unset($qv['paged']); + } } if ( '' != $qv['pagename'] ) {