I am developing a wordpress theme with parallax features and html5, the house has all of the primary pages and 2 different type of navigations.

Primary one, may be the navigation for parent pages. And So I have About, Projects and phone.

But every one of this pages has child pages. About page has one child that's below it, but when i cannot access in the primary menu, each page which has children's or subpages has got the second kind of menu.

Also projects, has different pages: "Projects" (primary), "Design" (child), Talking to (child), etc.

The 2nd menu that's positioned on the best from the page as rounded buttons lists parents "about" and also the child "a couple ofInch.

I already figured it a method to list individuals and also to result in the links behave with scroll to (parallax behavior)

But, the way in which i've hardcodes parents page. What i must do is to locate a method of getting dinamically the page ID therefore it will not be hardcoded, but because the theme functions as a just one page site, it's making me get troubles.

This is actually the code which i have, could anybody assist me to to find away out therefore the code will identify the ID of every current page to list out the primary and also the children pages ?

As you can see $parent = 13; is hardcoded, and it includes $pages = get_pages('hierarchical=0&include=13') ; using the id hardcoded too. So that all the web pages are showing exactly the same. I understand i can produce a conditional with is_page for every hardcoding it, however the idea is to really make it dynamic.

Any assistance will do well!



$parent = 13;
$args= array(
    'parent' => $parent,
    'hierarchical' => 0

            $pages = get_pages('hierarchical=0&include=13') ;

            foreach ( $pages as $page ) {
                $new_title = str_replace( " ", "", strtolower( $page->post_name ) );    
                echo '<li><a href="#' . $new_title . '" title="' . $page->post_title . '">' . $page->post_title . '</a></li>';

    $child_page_pages = get_pages($args);
    foreach ( $child_page_pages as $page ) {

                $new_title = str_replace( " ", "", strtolower( $page->post_name ) );    
                echo '<li><a href="#' . $new_title . '" title="' . $page->post_title . '">' . $page->post_title . '</a></li>';


To obtain publish parent page ID's you should use get_post_ancestors( $post ) it will return parents ID.

$ReturnParents = get_post_ancestors($post->ID);

Permanently you can test may be the global $post.

global $post;
global $wp_query; 

    $thePostID = $wp_query->post->ID; 
    $myParent = $post->post_parent; 

    echo "I am post ". $thePostID . " and my parent is " . $myParent;