Permalink
Browse files

Add support for previous_image_link() and next_image_link() to satisf…

…y WordPress.org requirements.
  • Loading branch information...
1 parent 17df772 commit 506ff352a2f0497c5fa1946851804725472d3387 @justintadlock committed Aug 26, 2012
Showing with 20 additions and 0 deletions.
  1. +7 −0 loop-nav.php
  2. +13 −0 style.dev.css
View
@@ -17,6 +17,13 @@
<?php next_post_link( '%link', '<span class="next">' . __( 'Next &rarr;', 'news' ) . '</span>' ); ?>
</div><!-- .navigation-links -->
+ <?php elseif ( is_attachment() ) : ?>
+
+ <div class="loop-nav navigation-links">
+ <?php previous_image_link( false, '<span class="previous">' . __( '&larr; Previous', 'news' ) . '</span>' ); ?>
+ <?php next_image_link( false, '<span class="next">' . __( 'Next &rarr;', 'news' ) . '</span>' ); ?>
+ </div><!-- .navigation-links -->
+
<?php elseif ( !is_singular() && current_theme_supports( 'loop-pagination' ) ) : loop_pagination(); ?>
<?php elseif ( !is_singular() && $nav = get_posts_nav_link( array( 'sep' => '', 'prelabel' => '<span class="previous">' . __( '&larr; Previous', 'news' ) . '</span>', 'nxtlabel' => '<span class="next">' . __( 'Next &rarr;', 'news' ) . '</span>' ) ) ) : ?>
View
@@ -778,6 +778,19 @@ h3#cluetip-title {
}
/* Pagination. */
+.navigation-links {
+ overflow: hidden;
+ clear: both;
+ margin: 0 20px;
+ padding: 20px 0;
+ }
+.navigation-links .previous {
+ float: left;
+ }
+.navigation-links .next {
+ float: right;
+ text-align: right;
+ }
.pagination, .page-links {
clear: both;
font-size: 12px;

0 comments on commit 506ff35

Please sign in to comment.