WordPress.org

Forums

Horizontal Page nav highlighting (1 post)

  1. friedrich
    Member
    Posted 7 years ago #

    i am having a horizontal page nav where i show only the first hierarchy level:
    <?php wp_list_pages('sort_column=menu_order&title_li=&depth=1&echo=1'); ?>

    the subnav is on the sidebar and shows up the children of the corresponding parent in the horizontal menu.

      <?php
      if($post->post_parent)
      $children = wp_list_pages("title_li=&child_of=".$post->post_parent."&echo=0"); else
      $children = wp_list_pages("title_li=&child_of=".$post->ID."&echo=0");
      if ($children) { ?>
      <?php echo $children; ?>

    So far this works great. But it would make a lot of sense to keep the parent in the horizontal navigation highlighted while one is browsing the children. Otherwise there's no connection betweeen the horizontal menu and the subpages. a.k.a. one doesn't know where one started...

    Has anyone done something like that?
    Best
    Friedrich

Topic Closed

This topic has been closed to new replies.

About this Topic