Ref: WP 2.1.3
If you’re talking about pages, not posts, and so the “category” discussion is irrelevant, here’s my suggestion.
Arrange the pages in a hierarchy using the “page parent” selection on the “edit page” screen.
Once the hierarchy is set, the template tag wp_list_pages
will give you lists to the depth required. You’ll need some technology to show/hide the lists of child pages (probably CSS and JavaScript). I’ll let someone else comment on that.
If you’re going to link from one page to another, and you’re using permalinks, remember to always refer to a page’s address with the trailing slash, e.g.
htref=”/parent/child/detail/”, not “/parent/child/detail” and if you’re linking from one place in the hierarchy to another, I’ve found it easier to come up with the right link if you think of the address of the page as, for instance, /parent/child/detail/index.htm. So, for instance, on the page “child” a link to “detail” will be href=”detail/” and from “detail” to “child” will be href=”../” — not surprising. However, if you have
parent/child/detail-one/
parent/child/detail-two/
the link on page “detail-one/” to “detail-two/” will need to be coded as “../detail-two/”, not “detail-two/”. To see this add the (invisible) “index.htm” to the end of each path — then it’s clear you need the “..” to get to “child” before descending to the “detail-two” directory.
So there’s the reason for always adding the slash to the end of the address. If you don’t, while the page will come up fine, all the relative links will be off and so will fail.
Again, WordPress functions like wp_list_pages will do this for you, but if you need to put links into the content of the page “by hand” (as you might if you’re using WordPress as a CMS), be sure to remember this.
[Sorry to go on so long. Hope this helps someone from spinning as many wheels as I’ve done today.]