Skip to content

Commit 5209dc0

Browse files
authored
Add missing checks for $prev_link and $next_link
1 parent d83213d commit 5209dc0

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/wp-content/themes/twentyten/loop.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,13 @@
3232
$next_link = $is_desc ? get_previous_posts_link( $new_posts_text ) : get_next_posts_link( $new_posts_text );
3333
?>
3434
<div id="nav-above" class="navigation">
35+
<?php if ( $prev_link ) : ?>
3536
<div class="nav-previous"><?php echo wp_kses_post( $prev_link ); ?></div>
37+
<?php endif; ?>
38+
39+
<?php if ( $next_link ) : ?>
3640
<div class="nav-next"><?php echo wp_kses_post( $next_link ); ?></div>
41+
<?php endif; ?>
3742
</div><!-- #nav-above -->
3843
<?php endif; ?>
3944

@@ -215,7 +220,12 @@
215220
<?php // Display navigation to next/previous pages when applicable. ?>
216221
<?php if ( $wp_query->max_num_pages > 1 ) : ?>
217222
<div id="nav-below" class="navigation">
223+
<?php if ( $prev_link ) : ?>
218224
<div class="nav-previous"><?php echo wp_kses_post( $prev_link ); ?></div>
225+
<?php endif; ?>
226+
227+
<?php if ( $next_link ) : ?>
219228
<div class="nav-next"><?php echo wp_kses_post( $next_link ); ?></div>
229+
<?php endif; ?>
220230
</div><!-- #nav-below -->
221231
<?php endif; ?>

0 commit comments

Comments
 (0)