diff --git a/wp-includes/post-template.php b/wp-includes/post-template.php index df161c0f00..c4b04fe88c 100644 --- a/wp-includes/post-template.php +++ b/wp-includes/post-template.php @@ -449,7 +449,7 @@ function wp_link_pages($args = '') { else $output .= ''; } - + } $output .= $link_before; $output .= $j; @@ -669,6 +669,8 @@ function wp_page_menu( $args = array() ) { $menu = ''; + $list_args = $args; + // Show Home in the menu if ( isset($args['show_home']) && ! empty($args['show_home']) ) { if ( true === $args['show_home'] || '1' === $args['show_home'] || 1 === $args['show_home'] ) @@ -676,12 +678,20 @@ function wp_page_menu( $args = array() ) { else $text = $args['show_home']; $class = ''; - if ( is_home() && !is_paged() ) + if ( is_front_page() && !is_paged() ) $class = 'class="current_page_item"'; $menu .= '
  • ' . $link_before . $text . $link_after . '
  • '; + // If the front page is a page, add it to the exclude list + if (get_option('show_on_front') == 'page') { + if ( !empty( $list_args['exclude'] ) ) { + $list_args['exclude'] .= ','; + } else { + $list_args['exclude'] = ''; + } + $list_args['exclude'] = get_option('page_on_front'); + } } - $list_args = $args; $list_args['echo'] = false; $list_args['title_li'] = ''; $menu .= str_replace( array( "\r", "\n", "\t" ), '', wp_list_pages($list_args) );