title: Wordpress : template tags get_page()
body: <p>not sure if this is programming enough or if it should go to superuser, which is not programming AT ALL. I leave it to the mod to decide.</p>
  
  <p>I created a menu using get_pages() and specifying the parent id. This parent id has children and sub-children and sub-subchildren. I need each of these (sub)children to have the parent id displayed, as this menu sits in the header.php file. So it will be included for all pages no matter their ancestry, and i would like that their section main item receives a specific class "currentlyActive".</p>
  
  <p>The code i made ony works for children, not for sub/ sub-sub children</p>
  
  <pre><code>&lt;li id="infographieButton"  &lt;?php echo ($post-&gt;ID == 5  || $post-&gt;post_parent == 5)? 'class="currentlyActive"': ''; ?&gt;&gt;
                                  &lt;a href="&lt;?php bloginfo('url')  ?&gt;/infographie/" class="menuHeader"&gt;&lt;span&gt;Infographie&lt;/span&gt;&lt;/a&gt;
                                  &lt;ul id="dropdownmenuInfographie"  class="submenu"&gt;
                                      &lt;?php
                                      $pages = get_pages('child_of=5&amp;parent=5&amp;sort_column=menu_order&amp;sort_order=asc&amp;title_li=');
                                      foreach($pages as $page) {
                                          ?&gt;
                                      &lt;li &lt;?php echo ($post-&gt;ID == $page-&gt;ID)? 'class="current_page_item"': ''; ?&gt;&gt;&lt;a href="&lt;?php echo get_page_link($page-&gt;ID) ?&gt;"&gt;&lt;?php
                                                  echo $page-&gt;post_title;
                                                  ?&gt;&lt;/a&gt;&lt;/li&gt;
  
                                      &lt;?php
                                      }
                                      ?&gt;
                                  &lt;/ul&gt;
                              &lt;/li&gt;
  </code></pre>
  
  <p>I'm a bit puzzled on how to achieve that in wordrpress. Any suggestion is welcomed!</p>