[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 16:18:37 UTC 2010
No problem!
I figured that out on http://wpdocs.labs.thedextrousweb.com/ that people have been talking about today; great tool (of course, the WP PHPXref at http://phpxref.ftwr.co.uk/wordpress/nav.html?index.html would have worked too, but I wanted to try the new RoR application).
The search function on the new RoR docs is so amazing!
On Apr 30, 2010, at 12:13 PM, Aldo Latino wrote:
> Il 30/04/2010 17:55, John Bloch ha scritto:
>> Ah. Right you are. My bad. This should work:
>>
>> $pages = count( explode( '<!--nextpage-->', $wp_query->post->post_content ) );
>
> Bingo! :D
> Thanks John!
>
> --
> 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