From f072bbbea72f953df66a2053c014d5414bd80ae0 Mon Sep 17 00:00:00 2001 From: Laury GvR Date: Fri, 10 Oct 2014 16:55:50 -0400 Subject: [PATCH] Steve's Navigation menu update from WildBills --- footer.php | 30 +++++++++----- functions.php | 110 ++++++++++++++++++++++++++++++++++++++++---------- index.php | 3 +- page-38.php | 3 +- sidebar.php | 3 +- style.css | 86 ++++++++++++++++++++++++++------------- 6 files changed, 171 insertions(+), 64 deletions(-) diff --git a/footer.php b/footer.php index 4a7d8a7..704434a 100755 --- a/footer.php +++ b/footer.php @@ -12,14 +12,24 @@ diff --git a/functions.php b/functions.php index dc3f9a6..e2e43f4 100644 --- a/functions.php +++ b/functions.php @@ -1,44 +1,110 @@ $ancestorId, + 'include' => $incl, + 'link_before' => '', + 'title_li' => '', + 'sort_column' => 'menu_order' + ) + ); + } + function glmAddSubs() + { + global $includePages, $post; + $pages = get_pages(array('parent' => 0)); + foreach ($pages as $page) { + $includePages[] = $page->ID; + } + } + function glmAddDescendants($glmPost) + { + global $includePages, $frontPageId, $ancestorId; + if ($glmPost->ID != $frontPageId) { + $includePages[] = "{$glmPost->ID}"; + $ancestorId = $glmPost->ID; + $descendants = get_pages(array('child_of' => $ancestorId)); + } else { + $ancestorId = $frontPageId; + } + + if (isset($descendants) && $descendants) { + foreach ($descendants as $page) { + if (($page->post_parent == $ancestorId) && + ($page->post_parent == $glmPost->ID)) + { + $includePages[] = $page->ID; + } + } + } + } + function glmAddParent($glmPost) + { + global $includePages, $frontPageId, $ancestorId; + $includePages[] = "{$glmPost->post_parent}"; + $parents = get_post_ancestors($glmPost->ID); + foreach ($parents as $page) { + $includePages[] = $page; + } + } + function glmAddSiblings($glmPost) + { + global $includePages, $frontPageId, $ancestorId; + glmAddDescendants(get_post($glmPost->post_parent)); + } +} + + // This theme only works in WP version 3.6 or higher. //if ( version_compare( $GLOBALS['wp_version'], '3.6', '<' ) ) { // require get_template_directory() . '/inc/back-compat.php'; //} - // Register all navigation menus //require_once('navigation.php'); -// -// + + //function register_my_menu() { -// register_nav_menu('header-menu',__( 'Header Menu' )); +// register_nav_menu('sidenav',__( 'sidenav' )); //} //add_action( 'init', 'register_my_menu' ); -// -// + + //function register_my_menus() { // register_nav_menus( // array( -// 'header-menu' => __( 'Header Menu' ), -// 'extra-menu' => __( 'Extra Menu' ) -// ) +// 'sidenav' => __( 'sidenav' ) +// ) // ); //} //add_action( 'init', 'register_my_menus' ); -// + //wp_nav_menu( array( 'theme_location' => 'header-menu' ) ); // //wp_nav_menu( array( 'theme_location' => 'extra-menu', 'container_class' => 'my_extra_menu_class' ) ); -// -//// Register Navigation Menus -//function custom_navigation_menus() { -// -// $locations = array( -// ); -// register_nav_menus( $locations ); -// -//} -// -//// Hook into the 'init' action -//add_action( 'init', 'custom_navigation_menus' ); +// Register Navigation Menus +function custom_navigation_menus() { + + $locations = array( + ); + register_nav_menus( $locations ); + +} + +// Hook into the 'init' action +add_action( 'init', 'custom_navigation_menus' ); ?> \ No newline at end of file diff --git a/index.php b/index.php index 888e46e..d1b5827 100644 --- a/index.php +++ b/index.php @@ -3,7 +3,8 @@