Support » Fixing WordPress » Sub navigation functionality

  • Hi,

    On my site: here

    I would like the subnavigation only to show when a user clicks on the parent that has children, I alo want to show the parent title

    at the moment, my left mavigation shows eveything and when I click on the sub navigation (child) the parent link disapears?!

    global $wp_query;
    if( empty($wp_query->post->post_parent) ) {
    $parent = $wp_query->post->ID;
    } else {
    $parent = $wp_query->post->post_parent;
    } ?>
    <?php if(wp_list_pages("title_li=&child_of=$parent&echo=0&depth=1" )): ?>
    <div id="submenu">
    $parent_title = get_the_title($post->post_parent);
    echo $parent_title;
    <?php wp_list_pages("title_li=&child_of=$parent" ); ?>
    <?php endif; ?>
  • The topic ‘Sub navigation functionality’ is closed to new replies.