Forums

Listing pages in sidebar, excluding top level pages (2 posts)

  1. andrisig
    Member
    Posted 5 years ago #

    Here is the problem, I yet to find a workable solution for this:

    I have a navigation bar in the header of my page that show only the top level links (depth=1) which works fine.

    How can I exclude level 1 pages from the sidebar navigation? On my subpages (Level 2, 3 etc) I would llike to list all child pages for a given top level item (Level 1) in a nested unorderd list. So if I'm on level 3, I still want all the pages ranging from level 2 and down.

    This is a very basic feature on most web sites. How can I do this?

  2. Oleinv
    Member
    Posted 5 years ago #

    If I understand right, you have:

    - Page --- (ID = X)
    -- Sub Page A
    -- Sub Page B
    -- Sub Page C

    and you want this in sidebar:

    -- Sub Page A
    -- Sub Page B
    -- Sub Page C

    Then add in sidebar <?php wp_list_pages('child_of=X' ); ?>
    Where X = ID of level 1 Page.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.