<?php
-function register_my_menu() {
- register_nav_menu('header-menu',__( 'Header Menu' ));
-}
-add_action( 'init', 'register_my_menu' );
/**
- * Left top bar
- * http://codex.wordpress.org/Function_Reference/wp_nav_menu
+ * glm_page_menu
+ *
+ * Grab the top level pages and their sub pages as the main navigation
*/
-if ( ! function_exists( 'foundationPress_top_bar_l' ) ) {
- function foundationPress_top_bar_l() {
- wp_nav_menu(array(
- 'container' => false, // remove nav container
- 'container_class' => '', // class of container
- 'menu' => '', // menu name
- 'menu_class' => 'top-bar-menu left', // adding custom nav class
- 'theme_location' => '', // where it's located in the theme
- 'before' => '', // before each link <a>
- 'after' => '', // after each link </a>
- 'link_before' => '', // before each link text
- 'link_after' => '', // after each link text
- 'depth' => 5, // limit the depth of the nav
- 'fallback_cb' => false, // fallback function (see below)
- 'walker' => new top_bar_walker()
- ));
- }
+function glm_page_menu()
+{
+ $frontPageId = get_option('page_on_front');
+ $parents = array();
+ $pages = get_pages(array(
+ 'post_type' => 'page',
+ 'parent' => -1,
+ 'number' => '',
+ 'exclude' => $frontPageId
+ ));
+ echo '<ul class="test">';
+ foreach ($pages as $page) {
+ $childs = get_pages('child_of=' . $page->ID);
+ if (count($childs) > 0) {
+ echo '<li';
+ if (count($childs) > 0) {
+ echo ' class="has-dropdown"';
+ }
+ echo '><a href="'.get_permalink($child->ID).'">'.$page->post_title.'</a>';
+ if (count($childs) > 0) {
+ echo '<ul class="sub-menu dropdown">';
+ foreach ($childs as $child) {
+ echo '<li><a href="'.get_permalink($child->ID).'">'.$child->post_title.'</a></li>';
+ }
+ echo '</ul>';
+ }
+ echo '</li>';
+ } else {
+ echo '<li><a href="'.get_permalink($page->ID).'">'.$page->post_title.'</a></li>';
+ }
+ }
+ echo '</ul>';
}
-// Add menu walker
-require_once('library/top-bar_walker.php');
/**
- * Mobile off-canvas
+ * glm_offcanvas_menu
+ *
+ * Generate the list of pages as nested ul li list
*/
-if ( ! function_exists( 'foundationPress_mobile_off_canvas' ) ) {
- function foundationPress_mobile_off_canvas() {
- wp_nav_menu(array(
- 'container' => false, // remove nav container
- 'container_class' => '', // class of container
- 'menu' => '', // menu name
- 'menu_class' => 'left-off-canvas-list', // adding custom nav class
- 'theme_location' => '', // where it's located in the theme
- 'before' => '', // before each link <a>
- 'after' => '', // after each link </a>
- 'link_before' => '', // before each link text
- 'link_after' => '', // after each link text
- 'depth' => 5, // limit the depth of the nav
- 'fallback_cb' => false, // fallback function (see below)
- 'walker' => new top_bar_walker()
- ));
- }
+function glm_offcanvas_menu()
+{
+ wp_page_menu(array(
+ 'depth' => 0,
+ 'sort_column' => 'menu_order',
+ 'menu_class' => 'left-off-canvas-list'
+ ));
}
-
?>
\ No newline at end of file
</nav>
</div>
<div class="small-6 medium-9"></div>
- </div>
+ </div>
<div class="row">
-
+
<div id="social" class="small-12 large-push-10 large-2 columns">
<div id="icons" class="right">
<a id="face" href="https://www.facebook.com/pages/Preston-Feather-Building-Centers/113480978684138?sk=photos"><img src="<?php echo get_template_directory_uri(); ?>/assets/facebook_icon.png"></a>
<a id="icon" href="#"><img src="<?php echo get_template_directory_uri(); ?>/assets/houzz_icon.png"></a>
</div>
</div>
- <a class="small-12 large-pull-8 large-4 columns" href="http://dev53.gaslightmedia.com/~ian/WordPress/"><img src="<?php echo get_template_directory_uri(); ?>/assets/logo.png"></a>
+ <a class="small-12 large-pull-8 large-4 columns" href="<?php bloginfo('url');?>"><img src="<?php echo get_template_directory_uri(); ?>/assets/logo.png"></a>
</div>
<div class="row show-for-large-up">
<div class="large-12 text-center columns">
<nav class="top-bar" data-topbar role="navigation">
<section class="top-bar-section">
- <?php foundationPress_top_bar_l(); ?>
-
+ <?php glm_page_menu(); ?>
</section>
</nav>
</div>
</section>
</nav>
<aside class="left-off-canvas-menu">
- <?php foundationPress_mobile_off_canvas(); ?>
+ <?php glm_offcanvas_menu(); ?>
</aside>
</header>
-
+