1. How can I assign Pages to categories (as either parent or child, or does it automatically do this?)
The code is just an example, I wrote:
Here is the code you would need to change this for pages.
This is UNTESTED code, so test on a local install!
if ( ! function_exists( 'digimag_child_pages' ) ) :
function digimag_child_pages() {
if ( is_page() ) {
global $post;
$id=$post->post_parent;
//No Parent Return Nothing
if(!$id) return "";
$list_args = 'style=list&child_of='.$id.'&depth=0&hierarchical=true&title_li=0&echo=0';
$pagelist = wp_list_pages($list_args);
$menu = str_replace( array( "\r", "\n", "\t" ), '', $pagelist );
echo $menu;
}
return "";
}
endif;
The call it
<?php if ( is_page() ) : ?>
<div id="access" role="navigation">
<div class="menu-header">
<ul class="menu">
<?php wp_nav_menu( array( 'container_class' => '','theme_location' => 'none','fallback_cb'=>'digimag_child_pages') ); ?>
<ul>
</div>
</div>
<?php endif; ?>
NOTE This code is for the Twenty Ten theme classes, and only works at two levels parent and child, if you had
Page 1
-Page 2
–Page 3
-Page 4
-Page 5
-Page 6
The visitor selected ‘Page 3’ the menu would only show ‘Page 3’ as Page 2 is the Parent
and ‘Page 1’ is the Ancestor
up another level in the tree.
If you are going to use three levels and you need to find the top level, then check this code
HTH
David