From b2105a943ee34a9af3dc8559864f28f603227e5b Mon Sep 17 00:00:00 2001 From: Mark Jaquith Date: Sat, 10 Mar 2007 06:09:52 +0000 Subject: [PATCH] Cleaner and more complete fix for [5017]. fixes #3949 git-svn-id: https://develop.svn.wordpress.org/trunk@5018 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-includes/post-template.php | 35 ++++++++++++++++++++--------------- 1 file changed, 20 insertions(+), 15 deletions(-) diff --git a/wp-includes/post-template.php b/wp-includes/post-template.php index 10636fe7bc..f1d468bacd 100644 --- a/wp-includes/post-template.php +++ b/wp-includes/post-template.php @@ -155,14 +155,11 @@ function wp_link_pages($args = '') { $j = str_replace('%',"$i",$pagelink); $output .= ' '; if ( ($i != $page) || ((!$more) && ($page==1)) ) { - if ( '' == get_option('permalink_structure') ) { - if ( $i == 1 ) - $output .= ''; - else - $output .= ''; + if ( 1 == $i ) { + $output .= ''; } else { - if ( $i == 1 ) - $output .= ''; + if ( '' == get_option('permalink_structure') ) + $output .= ''; else $output .= ''; } @@ -177,17 +174,25 @@ function wp_link_pages($args = '') { $output .= $before; $i = $page - 1; if ( $i && $more ) { - if ( '' == get_option('permalink_structure') ) - $output .= '' . $previouspagelink . ''; - else - $output .= ''.$previouspagelink.''; + if ( 1 == $i ) { + $output .= '' . $previouspagelink . ''; + } else { + if ( '' == get_option('permalink_structure') ) + $output .= '' . $previouspagelink . ''; + else + $output .= '' . $previouspagelink . ''; + } } $i = $page + 1; if ( $i <= $numpages && $more ) { - if ( '' == get_option('permalink_structure') ) - $output .= ''.$nextpagelink.''; - else - $output .= '' . $nextpagelink . ''; + if ( 1 == $i ) { + $output .= '' . $nextpagelink . ''; + } else { + if ( '' == get_option('permalink_structure') ) + $output .= '' . $nextpagelink . ''; + else + $output .= '' . $nextpagelink . ''; + } } $output .= $after; }