Make WordPress Core

Changeset 5018


Ignore:
Timestamp:
03/10/2007 06:09:52 AM (18 years ago)
Author:
markjaquith
Message:

Cleaner and more complete fix for [5017]. fixes #3949

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/post-template.php

    r5017 r5018  
    156156                $output .= ' ';
    157157                if ( ($i != $page) || ((!$more) && ($page==1)) ) {
    158                     if ( '' == get_option('permalink_structure') ) {
    159                         if ( $i == 1 )
    160                             $output .= '<a href="' . get_permalink() . $i . '">';
    161                         else
     158                    if ( 1 == $i ) {
     159                        $output .= '<a href="' . get_permalink() . '">';
     160                    } else {
     161                        if ( '' == get_option('permalink_structure') )
    162162                            $output .= '<a href="' . get_permalink() . '&amp;page=' . $i . '">';
    163                     } else {
    164                         if ( $i == 1 )
    165                             $output .= '<a href="' . get_permalink() . '">';
    166163                        else
    167164                            $output .= '<a href="' . trailingslashit(get_permalink()) . user_trailingslashit($i) . '">';
     
    178175                $i = $page - 1;
    179176                if ( $i && $more ) {
    180                     if ( '' == get_option('permalink_structure') )
    181                         $output .= '<a href="' . get_permalink() . '&amp;page=' . $i . '">' . $previouspagelink . '</a>';
    182                     else
    183                         $output .= '<a href="' . get_permalink() . $i . '/">'.$previouspagelink.'</a>';
     177                    if ( 1 == $i ) {
     178                        $output .= '<a href="' . get_permalink() . '">' . $previouspagelink . '</a>';
     179                    } else {
     180                        if ( '' == get_option('permalink_structure') )
     181                            $output .= '<a href="' . get_permalink() . '&amp;page=' . $i . '">' . $previouspagelink . '</a>';
     182                        else
     183                            $output .= '<a href="' . trailingslashit(get_permalink()) . user_trailingslashit($i) . '">' . $previouspagelink . '</a>';
     184                    }
    184185                }
    185186                $i = $page + 1;
    186187                if ( $i <= $numpages && $more ) {
    187                     if ( '' == get_option('permalink_structure') )
    188                         $output .= '<a href="' . get_permalink() . '&amp;page=' . $i . '">'.$nextpagelink.'</a>';
    189                     else
    190                         $output .= '<a href="' . trailingslashit(get_permalink()) . $i . '/">' . $nextpagelink . '</a>';
     188                    if ( 1 == $i ) {
     189                        $output .= '<a href="' . get_permalink() . '">' . $nextpagelink . '</a>';
     190                    } else {
     191                        if ( '' == get_option('permalink_structure') )
     192                            $output .= '<a href="' . get_permalink() . '&amp;page=' . $i . '">' . $nextpagelink . '</a>';
     193                        else
     194                            $output .= '<a href="' . trailingslashit(get_permalink()) . user_trailingslashit($i) . '">' . $nextpagelink . '</a>';
     195                    }
    191196                }
    192197                $output .= $after;
Note: See TracChangeset for help on using the changeset viewer.