I have a custom post type that I want to display the page you are on and how many pages total in this manner “Page 3 of 5” (meaning you are on page 3 of a 5 page post). These don’t have to be links, just plain text numbers.
I’d still like to keep the standard function of the wp_page_links parameter “next_or_number” set to “next”, but add this other page indicator.
I’ve tried experimenting with making my own funciton with some of the variables in the wp_page_links function on line 567 of the post-template.php file but I didn’t get anywhere.
The current / total page count is set up by
setup_postdata()
which runs at the beginning of the loop. So, if you’re in the loop, all you have to do is this:If you need to do that outside of the loop, do this first: