tags:

views:

367

answers:

2

I would like to display the page numbers in index.php, search.php and archive.php

As far as I'm aware, the variable $page contains the current page number, this works, but I just need the number of pages.

Also is there an easy way to get the URL for the next page and previous page for use any way you wish? next_posts_link(); and previous_posts_link(); don't seem to be able to do what I want.

Thanks.

A: 

I agree that there should be something similar to the $page variable. But if it's not in the WP codex, you could dive into the wonderful world of Custom Queries .

Rob van Groenewoud
+1  A: 

You can use (or look at the source of) this plugin:

WordPress > WP Page Numbers

nselikoff