/ Published in: PHP

Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
<?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. echo 'vewing page '.$pageNumber[current_page_id].' of '.$numberPages; ?>
Comments
