Support » Plugins and Hacks » How to seperate pages, some on top nav, all on side nav

  • Resolved christernyc

    (@christernyc)


    Hello,

    I am putting together a blog that has many pages. I only want 5 pages on the top nav, but I want the rest on the sidebar. I’ve looked everywhere for hacks and tried many plugins to no avail. Now I have to ask for help. Is there a way to to have separate page listings? Or a good hack to put certain pages on the sidebar with a nifty title?

    Basically, I’m looking to form pages on the dashboard and then have the option to put them up top or on the side nav, or both.

    Thanks in advance!

Viewing 2 replies - 1 through 2 (of 2 total)
  • What you can use is add a parameter to your two wp_list_pages commands.

    In your top nav:

    <ul>
      <?php wp_list_pages('include=5,9,23,16,11&title_li='); ?>
    </ul>

    will include, in that order, only the pages with the ID’s 5, 9, 23, 16, and 11

    In your sidebar

    <ul>
      <?php wp_list_pages('exclude=5,9,23,16,11&title_li='); ?>
    </ul>

    excludes all the pages displayed in your top nav. As you add new pages you can add them to either list. If you want a page in both top and side nav, add it to the top list and do not add it to the side list.

    This is a manual process but its simple. If you are not adding pages to Top Nav very often it should work fine.

    One way to automate it would be to add custom fields for IncludeInTopNav and ExcludeFromSideNav, and build the include and exclude lists dynamically using a database query.

    Neat, thanks!

    Everyday I learn a little bit more, I appreciate the help.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘How to seperate pages, some on top nav, all on side nav’ is closed to new replies.