When building templates for WordPress, you generally have pagination functions that come from the application itself.
These incude things like:
And there are a few other posts that give you greater granularity around taxonomies such as get_adjacent_post().
I recommend reading all of the above links because they are useful if you’re building a theme, working with custom post types, or are simply looking for a deeper understanding of some of the common template tags.
If, however, you’re looking for an easy way to write your WordPress pagination utility (which I’ll explain the rationale for momentarily), then the rest of this post will cover exactly that.