Skip to content

Instantly share code, notes, and snippets.

@krogsgard
Created February 6, 2013 19:34
Show Gist options
  • Save krogsgard/4725107 to your computer and use it in GitHub Desktop.
Save krogsgard/4725107 to your computer and use it in GitHub Desktop.
Simple navigation for pagination using previous_posts_link and next_posts_link for custom WP_Query
<?php
echo '<div class="loop-nav">';
previous_posts_link( '<div class="previous">' . __( 'Newer Entries', 'your-textdomain' ) . '</div>', $my_custom_query->max_num_pages );
next_posts_link( '<div class="next">' . __( 'Older Entries', 'your-textdomain' ) . '</div>', $my_custom_query->max_num_pages );
echo '</div><!-- .loop-nav -->';
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment