/ Published in: PHP
Expand |
Embed | Plain Text
<?php //get the sub pages for the parent page $subPages = get_pages('child_of=parent_page_id'); //$i will equal the page number $i=1; foreach($subPages as $subs){ //not sure what the exact array key for page_id will be. use var_dump($subPages)to find out //make the array key the page id for use later (as current_page_id) $pageNumber[$subs->page_id] = $i; } // Then show the page count and number pages for the page you are on. ?>
Comments
Subscribe to comments
You need to login to post a comment.

Got it from http://stackoverflow.com/questions/3393046/how-to-get-the-number-of-sub-page-child-pages-that-exist-in-wordpress