Small help required

Discussion in 'WordPress' started by vishalonne, Apr 28, 2012.

  1. #1
    Hi

    This is my code
    <?php
    //$output = wp_list_pages('echo=0&depth=1&title_li=<h1>Top Level Pages </h1>' );
    if(is_page())
    { ?>
    <div class="banner">
    </div>
    <?php
    $page = $post->ID;
    if ($post->post_parent) {
    $page = $post->post_parent;
    }
    $children=wp_list_pages( 'echo=0&child_of=' . $page . '&title_li=' );
    if ($children) {
    $output = wp_list_pages ('echo=0&child_of=' . $page . '&title_li=');
    } ?>
    <div id="menu">
    <div class="menu">
    <?php echo $output; ?> </div></div> <?php }
    ?>

    By this I am able to display my Child Pages, now Child Pages have some child pages whose links are coming in menu which is not required. How can stop display Sub Sub Child link on Child page.
    MID-CAP (Parent Page)
    MID 1 (Child Page of MID-CAP)
    MID-CAP SUB1 (Grand Child Page of MID-CAP)
    MID 2 (Child Page of Parent Page)
    MID-CAP SUB2 (Grand Child Page of MID-CAP)
    MID 3 (Child Page of Parent Page)
    MID-CAP SUB3 (Grand Child Page of MID-CAP)

    Now above code is showing all the pages child and grand child, but I only want to show child page. Please guide me how to do this.
    See in the attached image how the GRAND CHILD menus coming in RED BAR which I don't want.
    Thank you.
     

    Attached Files:

    vishalonne, Apr 28, 2012 IP
  2. raoraj

    raoraj Well-Known Member

    Messages:
    849
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    110
    #2
    why don't you use menu system in wordpress.
    see your dashbord, left menu bar.
     
    raoraj, Apr 29, 2012 IP
  3. mmedia

    mmedia Guest

    Messages:
    38
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    if you template seaports this option it will be the easyest way to implement this
     
    mmedia, Apr 29, 2012 IP