include('functions_pages.php'); wp_enqueue_script('prototype'); wp_enqueue_script('scriptaculous'); add_action('wp_head', 'add_build_page_tree'); function add_build_page_tree ( ) { echo "\n"; } function build_page_tree ( $args = '' ) { // this entire first part is stolen from wp_list_pages if ( is_array($args) ) { $r = &$args; } else { parse_str($args, $r); } // setup the default options $defaults = array('depth' => 0, 'show_date' => '', 'date_format' => get_option('date_format'), 'child_of' => 0, 'exclude' => '', 'title_li' => __('Pages'), 'echo' => 1, 'authors' => '', 'sort_column' => 'menu_order, post_title'); $r = array_merge($defaults, $r); $output = ""; $current_page = 0; // sanitize, mostly to keep spaces out $r['exclude'] = preg_replace('[^0-9,]', '', $r['exclude']); // Allow plugins to filter an array of excluded pages $r['exclude'] = implode(',', apply_filters('wp_list_pages_excludes', explode(',', $r['exclude']))); // Query pages. $pages = get_pages($r); if ( !empty($pages) ) { if ( $r['title_li'] ) $output .= '