Question

Most of my WordPress sites to date have been blog content, along with a 1 or 2 level page hierarchy.

I'm now looking at developing a site with the customer site map suggests that a hierarchy of 4 levels of page content is required. In terms of WordPress the hierarchy is easy to create, but I'm looking at the ways of providing navigation in the theme for this page hierarchy.

One thing I've seen is the Fold page list plug-in, but can't find much else on the subject. I was wondering if anyone has any examples or experiences they can suggest for how best to provide the navigation in the theme for a deep page hierarchy like this?

EDIT - To clarify, I haven't currently selected a navigation type, this is part of the question. In a 2 level page hierarchy I normally use a top nav for the 1st level, with dropdown showing the 2nd level of navigation

This isn't easily going to extend to 4 levels of navigation (unless we go for multiple menus opening similar to the Windows start button type menus, or the menumatic example in this article).

So I am considering what alternate approaches are available e.g. top level navigation on a top bar, and then a sidebar showing 2nd level navigation headings, with expandable subsections as you drill down to the 3rd and 4th level. E.g. see the 'in action' section at the bottom right of the fold page list plugin webpage

However there may well be other good approaches to this, hence the question, to try and understand how other people approach providing navigation within WordPress to a deep hierarchy of page content

Was it helpful?

Solution

menu with non dynamic content

  1. if the menu structure is fixed then you can create a fixed menu using the "new" wp menu system (quadrillion weblog postings on that)

menu with dynamic content

  1. if the menu structure is not fixed you can:

    a. ask the users to manually maintain the menu after e.g. adding a new category

    b. try to hook on everything that goes in the menu e.g. a new category and add it to the menu to prevent these manual actions for your users

    c. choose another "non-wp" menu and fill that dynamically on each page load (obviously with caching). example: to put a counter (67) behind the entries that represent tag pages

In case of option (c) I would go to e.g.: http://www.mycssmenu.com/ generate the code for a menu you like, then copy and paste the javascript and css for that menu in your header.php of your theme. (I don't know who owns that site but the GUI system for creating a new menu is absolute very cool).

Then replace the content bits (really simple: only the li items) with some code that e.g. queries the amount of categories in a hierarchical loop and replace the li items by dynamic output.

--> In that way you have a dynamic menu with dynamic content and you can play with the code to do whatever you like with it in your menu.

Example

The menu generator generated me .css and .javascript and my example content of the menu. I replaced the example content with calls to a function "taglinklineRounded":

<li><a class="qmparent" href="javascript:void(0)">ARTS</a>
        <ul>
        <li><span class="qmtitle" >Listen</span></li>
        <?php echo taglinklineRounded('music',    'Music') ?>
        <?php echo taglinklineRounded('radio',    'Radio') ?>
        <li><span class="qmdivider qmdividerx" ></span></li>
        <li><span class="qmtitle" >Look</span></li>
        <?php echo taglinklineRounded('comics',   'Graphics') ?>
        <?php echo taglinklineRounded('photo',    'Photo') ?>
        <?php echo taglinklineRounded('graphics', 'Graphics') ?>
        <?php echo taglinklineRounded('art',      'Art') ?>
        <li><span class="qmdivider qmdividerx" ></span></li>
        <li><span class="qmtitle" >View</span></li>
        <?php echo taglinklineRounded('tv',       'TV') ?>
        <?php echo taglinklineRounded('video',    'Video') ?>
        <?php echo taglinklineRounded('movie',    'Movie') ?>
        <li><span class="qmdivider qmdividerx" ></span></li>
        <li><span class="qmtitle" >Read</span></li>
        <?php echo taglinklineRounded('book',     'Book') ?>
        <?php echo taglinklineRounded('writing',  'Writing') ?>
        <?php echo taglinklineRounded('news',     'News') ?>
        <li><span class="qmdivider qmdividerx" ></span></li>
        <li><span class="qmtitle" >Specific</span></li>
        <?php echo taglinklineRounded('scifi',    'Sci-Fi') ?>
        <?php echo taglinklineRounded('lost',     'LOST') ?>
        </ul></li>

The taglinklineRounded function gives me the amount of entries that have this tag (but obviously any whatever code can be done on the menu structure).

In a more dynamic approach you read the categories / whatever other content needs to be in the menu and instead of in the example the hardcoded 'scifi' ... replace it with an echo statement of the output of that categories.

(also ofcourse as deep as you want represented in the style choosen).

Other idea

I guess you can even combine the standard wp menu with the dynamic menu by having certain parts in the menu managed by the users and others dynamic by combining the outputs in a new dynamic menu. Haven't played with that.

OTHER TIPS

Do you mean you want a bread-crumb type nav? Or list all the pages that are children of the current page What exactly do you mean? I've done a lot of stuff like this, so I'll probably have a chunk of code somewhere for this.

Licensed under: CC-BY-SA with attribution
Not affiliated with wordpress.stackexchange
scroll top