• I have downloaded dozens of templates and I cannot find what I am looking for. I want a template that will support subcategories and show the hierarchy in the sidebar. It must also support subpages and change sidebar page menu based on the parent page. Is this template out there?

    I don’t care about colors-I think I can tinker with that.

Viewing 1 replies (of 1 total)
  • If I’m understanding you, the WordPress Default Theme will do most of that, and this change should handle the rest–

    For use in sidebar, display only top level Pages, but when viewing a Page that has children (or is a child) show only children of that parent
    When visiting main page, all top level pages are listed in the sidebar.
    When click on a top level page with no children, all top level pages are listed.
    When click on a top level page with children, just the children pages are listed.
    When click on a children page, just the children of that parent are listed.

    <?php
    $output = wp_list_pages('echo=0&depth=1&title_li=<h2>Top Level Pages </h2>' );
    if (is_page( )) {
      $page = get_query_var('page_id');
      if ($post->post_parent) {
        $page = $post->post_parent;
      }
      $children=wp_list_pages( 'echo=0&child_of=' . $page . '&title_li=' );
      if ($children) {
        $output = wp_list_pages ('echo=0&child_of=' . $page . '&title_li=<h2>Child Pages</h2>');
      }
    }
    echo $output;
    ?>

Viewing 1 replies (of 1 total)
  • The topic ‘Looking for subpage and subcategory template’ is closed to new replies.