Making WordPress.org

Ticket #638: 638.diff

File 638.diff, 1.6 KB (added by xkon, 7 years ago)

Adding Next / Previous links to archive pages

  • buddypress.org/public_html/wp-content/themes/bb-base/archive.php

     
    11<?php get_header(); ?>
    22<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
    3                         <h3 id="post-<?php the_ID(); ?>"><a href="<?php the_permalink() ?>" rel="bookmark"><?php the_title(); ?></a></h3>
     3                        <h3 id="post-<?php the_ID(); ?>"><a href="<?php the_permalink(); ?>" rel="bookmark"><?php the_title(); ?></a></h3>
    44                        <cite><?php printf( __( 'Published on %s by %s', 'bbporg' ), get_the_time( 'F jS, Y' ), get_the_author_link() ); ?></cite>
    55                        <div class="single-post archive" id="post-<?php the_ID(); ?>"><?php the_excerpt(); ?></div>
    6 <?php endwhile;  else : ?>
    7                         <p><em><?php _e( 'Sorry, no posts matched your criteria.' ); ?></em></p>
     6<?php endwhile; if ( get_next_posts_link() ) : ?>
     7        <div class="nav-previous alignleft"><?php next_posts_link( __( '<span class="meta-nav">&larr;</span> Older posts' ) ); ?></div>
     8<?php endif; if ( get_previous_posts_link() ) : ?>
     9        <div class="nav-next alignright"><?php previous_posts_link( __( 'Newer posts <span class="meta-nav">&rarr;</span>' ) ); ?></div>
     10<?php endif; else : ?>
     11        <p><em><?php _e( 'Sorry, no posts matched your criteria.' ); ?></em></p>
    812<?php endif; ?>
    9                         <hr class="hidden" />
    10 <?php get_sidebar(); get_footer(); ?>
    11  No newline at end of file
     13        <hr class="hidden" />
     14<?php get_sidebar(); get_footer(); ?>
     15