Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
  • #22071

    Ok here it goes, i hope I’m able to explain what i want :-D

    I like the idea of “Page Sidebar navigation”. However it shows pages, subpages and subpages of subpages.

    So suppose i have a page A with three subpages A1 A2 & A3. All of the subpages also have subpages.

    What i would like to achieve is that the Page Sidebar navigation only shows A1 A2 & A3 for page A (and not the subpages of subpages)

    When clicking a subpage I would like the Page Sidebar navigation to only show the subpages of this subpage.

    Is this possible?


    Are you talking about using the custom widgets menu? You can easily setup a new menu by clicking on the + tab under Appearance > Menus and add whatever pages or subpages you want on there. Then you can go to Appearance > Widgets and place a Custom Menu widget into the corresponding sidebar (i.e. blog pages). Not sure if I get your question but is this what you are referring to?



    Indeed it was sort of his question, since I think he was talking about the functionality that automatically displays all the children of any page if they exist as a hierarchy.

    Page A has two children A1 and A2. A1 has two children A1a and A1b and A2 has one child A2a. You want the A1 and A2 to show up and A1a , A1b, A2a to not show up?

    To do this, open up sidebar.php in the root theme folder and find line 53 that looks like

    $children = wp_list_pages("title_li=&child_of=". $parent ."&echo=0");

    and replace it with this code below:

    $children = wp_list_pages("title_li=&depth=1&child_of=". $parent ."&echo=0");

    That should limit it to a depth of 1 level down in children.



Viewing 3 posts - 1 through 3 (of 3 total)

The topic ‘Page Sidebar navigation’ is closed to new replies.