• Hey people,

    Ive been searching for a method to show a menu in a widget or in another way, when page or category is #blabla.

    Imagine u making a website for an insurrence company. They have lots of insurrences but for every insurrence there is another menu.

    Now I dont want to create 20 different sidebars with different widget areas with different menus (Really dont think that is do able). So i was thinking what if i can look for a script (or write it my self.. not the best php programmer but ye) that Requests the page or category and then show a menu that is made for it.

    This is a small version of the sitemap so u can sketch the picture with me:

    Particulier -> Inssurence (this menu got 20 options) -> One of the 20 options -> This new page got 5 different options again.

    The question
    Is any1 familier with this kind of wordpress using? Is there a functionality that is intergrated in wordpress. Or what if i do the code myself where can i find menu’s ids or ways to “print” menus.

    Kind regards

    Rick

Viewing 1 replies (of 1 total)
  • Thread Starter rootboy03

    (@rootboy03)

    SOLVED

    If anyone wanna use the same code i used/editted.

    <?php
      $children = wp_list_pages('title_li=&child_of='.$post->ID.'&echo=0&depth=1');
      if ($children) { ?>
      <ul>
      <?php echo $children; ?>
      </ul>
      <?php }
    else {
    $children2 = wp_list_pages("title_li=&child_of=".$post->post_parent."&echo=0&depth=1");
    } ?>
    <ul>
      <?php echo $children2; ?>
      </ul>

    if statement: Shows the childeren of a page and if end page doesnt have childeren.

    Else: Show it from the last parent.

Viewing 1 replies (of 1 total)

The topic ‘Show menu #number when page is’ is closed to new replies.