We are designign a new template with more concern on pages. The purpose is to have a dinamically generated section to host permanent content with several subsections - “riki” - with a slightly different layout, from the other sections of the site and a customized navigation sidebar of the single “riki”.

Download and install phprun and to run php code in your pages and posts.

Then that make a new template by adding this lines to a “single” .php file:

//< ? php /* Template Name: riki */ ?>

before the xhtml declaration.

Go to you sidebar tempate - Sidebar.php - and take your wp_list_pages function, it should look like this:

/*< ? php wp_list_pages('sort_column=menu_order&title_li=
&child_of=x&depth=y'); ?>*/

My sidebar has icons and stuff…but doesn-t care for now..

Change the function to your own function, like this:

/*< ? php wp_list_pages_riki('sort_column=menu_order&title_li=
&child_of=x&depth=y' );?>*/

After do that go to /wp/wp-includes/template-functions-post.php and copy this functions:

function wp_list_pages /*and*/ function _page_level_out

And place between the two brackets here:

/*< ? php Template Name: riki ?>*/ after the php declaration.

Make sure to change the name of the to functions to:

wp_list_pages_riki

function _page_level_out_riki and save.

After do you can create a layer in the CSS to place the list list_pages in your pages, something will look like:

/*< ? php wp_list_pages_riki('sort_column=menu_order&title_li=
&child_of=x&depth=y' );?>*/

This will display links of the entire section missing the root page of it…you can adding it manually in the page.

It-s not fully dinamic but it goes…any suggestion to make it work better?

Good resources on the same topic here.