From c163f7549350731e47ac11f6515ab8c2cfdcd204 Mon Sep 17 00:00:00 2001 From: Ian Weller Date: Fri, 13 Jan 2017 15:00:29 -0500 Subject: [PATCH] Updated the menu options I updated the menu options from what was there originally. --- functions.php | 85 +++++++++++++++++++++++++++++++++++++-- parts/off-canvas-menu.php | 2 +- parts/top-bar.php | 2 +- 3 files changed, 84 insertions(+), 5 deletions(-) diff --git a/functions.php b/functions.php index aa939e5..ed18ada 100644 --- a/functions.php +++ b/functions.php @@ -23,7 +23,86 @@ if (!function_exists('glm_quicksite_widget_init')) { } } - +register_nav_menus(array( + 'top-bar' => 'Site Navigation', + 'footer' => 'Footer Navigation', + 'second-header' => 'Secondary Header Navigation' +)); +/** + * Top Bar + */ +if ( ! function_exists( 'glm_theme_top_bar' ) ) { + function glm_theme_top_bar() { + wp_nav_menu(array( + 'container' => false, // remove nav container + 'container_class' => '', // class of container + 'menu' => '', // menu name + 'menu_class' => '', // adding custom nav class + 'theme_location' => 'top-bar', // where it's located in the theme + 'before' => '', // before each link + 'after' => '', // after each link + 'link_before' => '', // before each link text + 'link_after' => '', // after each link text + 'depth' => 3, // limit the depth of the nav + 'fallback_cb' => false, // fallback function (see below) + 'walker' => new Glm_Theme_Top_Bar_Walker() + )); + } +} +/** + * Footer + */ +if ( ! function_exists( 'glm_theme_footer' ) ) { + function glm_theme_footer() { + wp_nav_menu(array( + 'container' => false, // remove nav container + 'container_class' => '', // class of container + 'menu' => '', // menu name + 'menu_class' => '', // adding custom nav class + 'theme_location' => 'footer', // where it's located in the theme + 'before' => '', // before each link + 'after' => '', // after each link + 'link_before' => '', // before each link text + 'link_after' => '', // after each link text + 'depth' => 3, // limit the depth of the nav + 'fallback_cb' => false, // fallback function (see below) + 'walker' => new Glm_Theme_Top_Bar_Walker() + )); + } +} +/** + * Secondary Header Navigation +**/ +if ( ! function_exists( 'glm_theme_second_header' ) ) { + function glm_theme_second_header() { + wp_nav_menu(array( + 'container' => false, // remove nav container + 'container_class' => '', // class of container + 'menu' => '', // menu name + 'menu_class' => '', // adding custom nav class + 'theme_location' => 'second-header', // where it's located in the theme + 'before' => '', // before each link + 'after' => '', // after each link + 'link_before' => '', // before each link text + 'link_after' => '', // after each link text + 'depth' => 3, // limit the depth of the nav + 'fallback_cb' => false, // fallback function (see below) + 'walker' => new Glm_Theme_Top_Bar_Walker() + )); + } +} +/** + * Mobile off-canvas + */ +if ( ! function_exists( 'glm_theme_mobile_off_canvas' ) ) { + function glm_theme_mobile_off_canvas() { + echo '
'; + echo '
'; + } +} /** * get_menu_options * @@ -142,8 +221,8 @@ function glm_get_header() { if (has_post_thumbnail()) { $image_data = wp_get_attachment_image_src(get_post_thumbnail_id(), "full"); echo ' style="background-image: url('.$image_data[0].');height:0;padding:0;padding-bottom:20%;background-position:center center;background-size: 100%;background-repeat:no-repeat;'; - } else { - echo ' style="background-image: url('.get_template_directory_uri().'/assets/default-header.gif);height:0;padding:0;padding-bottom:30%;background-position:center center;background-size: 100%;background-repeat:no-repeat;'; +// } else { +// echo ' style="background-image: url('.get_template_directory_uri().'/assets/default-header.gif);height:0;padding:0;padding-bottom:30%;background-position:center center;background-size: 100%;background-repeat:no-repeat;'; } echo 'max-height: 300px; ">'; echo ''; diff --git a/parts/off-canvas-menu.php b/parts/off-canvas-menu.php index dcbc0d1..23a839d 100644 --- a/parts/off-canvas-menu.php +++ b/parts/off-canvas-menu.php @@ -1,5 +1,5 @@