<?php if ( have_posts() ) : ?> <!-- Add the pagination functions here. → posts_nav_link() <!-- Start of the main loop. --> <?php while ( have_posts() ) : the_post(); ?> <!-- the rest of your theme's main loop --> <?php endwhile; ?> <!-- End of the main loop --> <!-- Or add the pagination functions here. --> <div class="nav-previous alignleft"><?php previous_posts_link( 'Older posts' ); ?></div> <div class="nav-next alignright"><?php next_posts_link( 'Newer posts' ); ?></div> <?php else : ?> <p><?php _e('Sorry, no posts matched your criteria.'); ?></p> <?php endif; ?>
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter