Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

Does WordPress have any built-in pagination functions to show the page numbers instead of previous and next page links?

If not, how can I add that?

Thanks

share|improve this question
add comment

2 Answers 2

up vote 2 down vote accepted

It depends on which pagination you're talking about:

  • Archive Index pagination
  • Single-Post pagination
  • Comments pagination

In all three cases, the answer is yes, but the implementation is different.

Archive Index Pagination

WordPress provides a function, paginate_links(), for post-archive pagination links. It's use isn't exactly straightforward, but fortunately, implementation is mostly cut-and-paste from the Codex example.

Here's how I use it in Oenology.

Single-Post Pagination

WordPress provides a function, wp_link_pages(), for intra-post pagination links. It's use is straight-forward, as a normal template tag.

Comments Pagination

WordPress provides a function, paginate_comments_links(), for comments pagination links. This template tag is actually a wrapper for paginate_links(), but its use is straight-forward.

share|improve this answer
add comment

Try using the WP page navi plugin. http://wordpress.org/extend/plugins/wp-pagenavi/

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.