WordPress.org

Ready to get started?Download WordPress

Forums

Sub menu with child page (1 post)

  1. Cherubin13
    Member
    Posted 5 years ago #

    Hello,

    i'm a french user of wordpress, so forgive me my poor english in advance please.
    I would like to have the same system like this blog : http://www.fredcavazza.net
    When we select a mother page, it child pages are showed. I would like do the same on -http://new.infocompub.fr But i don't understand how do this...

    I tryed this :

    <div id="nav">
    <ul id="navlist">
    
    <li<?php if(is_home()) echo ' class="current_page_item"' ?>><a href="<?php bloginfo('url'); ?>/">Accueil</a></li>
    
    <ul>
      <?php// wp_list_pages('sort_column=menu_order&title_li='); ?>
    </ul>
    
    <?php
    $post=htmlspecialchars($_GET["page_id"]);
    if (is_home())
    {
    }
    else
    {
    if ( $post->post_parent != 0) {
      wp_list_pages('title_li=&sort_column=menu_order&child_of='.$post->post_parent);
    } else {
      wp_list_pages('title_li=&sort_column=menu_order&child_of='.$post->ID);
    }
    }
    ?>
    
    </div>

    The problem is that the parent pages don't present on the home or all pages, and i would like to have all parent pages, and child page in submenu when we choose one of the mother page.

    How do this please?

    Thanks a lot :)

Topic Closed

This topic has been closed to new replies.

About this Topic