Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- echo "<pre>";
- /* Trying to get this page ID */
- function getPageID(){
- if(have_posts()) {
- while(have_posts()) {
- the_post();
- $portfolio_page_id = get_the_ID();
- }
- }
- return $portfolio_page_id;
- }
- /* Get all subpages for the given page ID */
- function getSubPages($thisPageID){
- $my_wp_query = new WP_Query();
- $pages_to_get = array(
- 'post_type' => 'page',
- 'order' => 'ASC',
- 'orderby' => 'menu_order'
- );
- $all_wp_pages = $my_wp_query->query($pages_to_get);
- return get_page_children($thisPageID, $all_wp_pages );
- }
- $children = getSubPages(getPageID());
- print_r($children);
- echo "</pre>";
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement