[wp-hackers] Access the total number of pages of a multipage post or page out of the loop

John Bloch jbloch at olympianetworks.com
Fri Apr 30 10:27:23 UTC 2010


Try adding

global $numpages;

to your header file (or whatever function is generating the head tags you're
writing).

John P. Bloch


On Fri, Apr 30, 2010 at 12:45 AM, Aldo Latino <aldolat at gmail.com> wrote:

> Il 30/04/2010 04:43, Mark Duncan ha scritto:
> > Inside the loop get the value of $numpages (global if necessary), and it
> > should give you the total amount of pages in accordance with your usage
> > of <!--nextpage--> for that post/page.
> >
> > Tested on trunk, and returns the correct value for a paged post..
> >
> > Hope that helps.
>
> Thanks for your reply, but I need to retrieve the total number of pages
> outside the loop, namely in the <head> section of the page.
>
> --
> Aldo Latino
> OpenPGP key: 4096R/0xA18E41E8 | bit.ly/keyDSA
> 84E2 2BC8 ABE3 DCC0 9F15  E511 4357 7ECD 4397 C730
> _______________________________________________
> wp-hackers mailing list
> wp-hackers at lists.automattic.com
> http://lists.automattic.com/mailman/listinfo/wp-hackers
>


More information about the wp-hackers mailing list