Organizing a Site Using WP’s Pages
-
I love WordPress, and I especially love its Pages feature; it is what I have always wanted in a blogging (or forum) software but have yet to find outside of a bloated CMS. Anyway, I would very much like to use WordPress’ Pages to create an entire website–blog and static content.
In the description of Pages I read somewhere, it said that they could be used to build even corporate-level websites.
However, I’m stuck. If I keep adding content and sub-Pages and so on, the menu of Pages on the sidebar will keep getting bigger and bigger.
I tried setting the sidebar depth to 1. Great!
I then tried adding code to the page.php template file to include a second page list with only that page’s children using the child_of parameter of wp_list_pages().
Unfortunately, I have not found a way to dynamically generate the ID of the page within the child_of= bit. I tried using the_ID() and even setting a variable to the_ID() and using the variable instead. Both yield errors.
My question is twofold:
If what I’m doing is not the easiest/best way to implement a website using Pages, what is? Surely there is a tutorial out there that I can’t for the life of me find.
Second, how can you use the child_of parameter with a dynamic ID, so that it can be included in page.php to change depending on which page is shown? It would do no good to hardcode an ID into that in a template file when I’m trying to show the children pages of the current page on display, which varies.
- The topic ‘Organizing a Site Using WP’s Pages’ is closed to new replies.