WordPress.org

Ready to get started?Download WordPress

Forums

how to highlight child nav link? (1 post)

  1. joyceliu6
    Member
    Posted 1 year ago #

    I'm having a side bar navigation menu -replicate of the main navigation menu
    How can I get the child nav link highlighted when I'm on a child page.
    Here is what I've go so far

    <div class="menu_side">
    <?php
      if($post->post_parent) {
      $children = wp_list_pages("title_li=&child_of=".$post->post_parent."&echo=0");
      $titlenamer = get_the_title($post->post_parent);
      }
    
      else {
      $children = wp_list_pages("title_li=&child_of=".$post->ID."&echo=0");
      $titlenamer = get_the_title($post->ID);
      }
      if ($children) { ?>
      <ul>
    <li id="menu_sideheading"><?php echo $titlenamer; ?></li>
      <li><?php echo $children; ?></li>
      </ul>
    </div>
    <?php } ?>

    Help! Please

    [ Please do not bump, that's not permitted here. ]

Topic Closed

This topic has been closed to new replies.

About this Topic