From: Ian Weller Date: Mon, 26 Oct 2015 18:13:45 +0000 (-0400) Subject: created custom off canvas menus X-Git-Tag: v1.0.0^2~427 X-Git-Url: http://cvs2.gaslightmedia.com/gitweb/?a=commitdiff_plain;h=36fa0c167306d86887b7f0b619d2977ebb0bd206;p=WP-Themes%2Fstaffords.git created custom off canvas menus --- diff --git a/assets/staffords-logo.png b/assets/staffords-logo.png new file mode 100644 index 0000000..8791250 Binary files /dev/null and b/assets/staffords-logo.png differ diff --git a/functions.php b/functions.php index a817d81..b090603 100644 --- a/functions.php +++ b/functions.php @@ -79,8 +79,8 @@ function glm_page_menu($parent = 0, $class = '') } register_nav_menus(array( - 'top-bar' => 'Site Navigation', - 'mobile-off-canvas' => 'Mobile', +// 'top-bar' => 'Site Navigation', +// 'mobile-off-canvas' => 'Mobile', 'property-bar' => 'Properties Navigation', 'art-bar' => 'Art Gallery Navigation', 'bay-bar' => 'Bay View Inn Navitgation', @@ -92,6 +92,17 @@ register_nav_menus(array( 'vacation-bar' => 'Vacation Rental Navigation', 'weathervane-bar' => 'Weathervane Restaurant Navigation', 'about-bar' => 'About Navigation', + 'art-canvas' => 'Art Gallery Mobile', + 'property-canvas' => 'Properties Mobile', + 'bay-canvas' => 'Bay View Inn Mobile', + 'river-canvas' => 'Crooked River Lodge Mobile', + 'bridge-canvas' => 'Drawbridge Bistro Mobile', + 'perry-canvas' => 'Perry Hotel Mobile', + 'pier-canvas' => 'Pier Restaurant Mobile', + 'boat-canvas' => 'Pointer Boat Mobile', + 'vacation-canvas' => 'Vacation Rental Mobile', + 'weathervane-canvas' => 'Weathervane Mobile', + 'about-canvas' => 'About Mobile', // 'footer' => 'Footer' )); @@ -396,15 +407,283 @@ if (!function_exists('glm_get_clientinfo_option')) { * * Generate the list of pages as nested ul li list */ -function glm_offcanvas_menu() -{ - wp_page_menu(array( - 'depth' => 0, - 'sort_column' => 'menu_order', - 'menu_class' => 'left-off-canvas-list' - )); + +if ( ! function_exists( 'stafford_mobile_off_canvas' ) ) { + function stafford_mobile_off_canvas() { + echo ''; + } +} +if ( ! function_exists( 'art_mobile_off_canvas' ) ) { + function art_mobile_off_canvas() { + echo ''; + } +} +if ( ! function_exists( 'bay_mobile_off_canvas' ) ) { + function bay_mobile_off_canvas() { + echo ''; + } +} +if ( ! function_exists( 'river_mobile_off_canvas' ) ) { + function river_mobile_off_canvas() { + echo ''; + } +} +if ( ! function_exists( 'bridge_mobile_off_canvas' ) ) { + function bridge_mobile_off_canvas() { + echo ''; + } } +if ( ! function_exists( 'perry_mobile_off_canvas' ) ) { + function perry_mobile_off_canvas() { + echo ''; + } +}if ( ! function_exists( 'pier_mobile_off_canvas' ) ) { + function pier_mobile_off_canvas() { + echo ''; + } +} +if ( ! function_exists( 'boat_mobile_off_canvas' ) ) { + function boat_mobile_off_canvas() { + echo ''; + } +} +if ( ! function_exists( 'vacation_mobile_off_canvas' ) ) { + function vacation_mobile_off_canvas() { + echo ''; + } +} +if ( ! function_exists( 'weathervane_mobile_off_canvas' ) ) { + function weathervane_mobile_off_canvas() { + echo ''; + } +} +if ( ! function_exists( 'about_mobile_off_canvas' ) ) { + function about_mobile_off_canvas() { + echo ''; + } +} +if ( ! class_exists( 'Stafford_Offcanvas_Walker' ) ) : +class Stafford_Offcanvas_Walker extends Walker_Nav_Menu { + function display_element( $element, &$children_elements, $max_depth, $depth = 0, $args, &$output ) { + $element->has_children = ! empty( $children_elements[ $element->ID ] ); + $element->classes[] = ( $element->current || $element->current_item_ancestor ) ? 'active' : ''; + $element->classes[] = ( $element->has_children && 1 !== $max_depth ) ? 'page_item_has_children' : ''; + $element->classes[] = 'page_item'; + + parent::display_element( $element, $children_elements, $max_depth, $depth, $args, $output ); + } + + function start_el( &$output, $object, $depth = 0, $args = array(), $current_object_id = 0 ) { + $item_html = ''; + parent::start_el( $item_html, $object, $depth, $args ); + + $classes = empty( $object->classes ) ? array() : (array) $object->classes; + + if ( in_array( 'label', $classes ) ) { + $item_html = preg_replace( '/]*>(.*)<\/a>/iU', '', $item_html ); + } + + $output .= $item_html; + } + + function start_lvl( &$output, $depth = 0, $args = array() ) { + $output .= "\n'; + } + +} +endif; add_theme_support('post-thumbnails'); set_post_thumbnail_size(120, 100, true); /** diff --git a/parts/off-canvas_about.php b/parts/off-canvas_about.php new file mode 100644 index 0000000..82f78d4 --- /dev/null +++ b/parts/off-canvas_about.php @@ -0,0 +1,35 @@ + + \ No newline at end of file diff --git a/parts/off-canvas_art-gallery.php b/parts/off-canvas_art-gallery.php new file mode 100644 index 0000000..d5694ab --- /dev/null +++ b/parts/off-canvas_art-gallery.php @@ -0,0 +1,35 @@ + + \ No newline at end of file diff --git a/parts/off-canvas_bay-view.php b/parts/off-canvas_bay-view.php new file mode 100644 index 0000000..ecbb391 --- /dev/null +++ b/parts/off-canvas_bay-view.php @@ -0,0 +1,35 @@ + + \ No newline at end of file diff --git a/parts/off-canvas_crooked-river.php b/parts/off-canvas_crooked-river.php new file mode 100644 index 0000000..07c4207 --- /dev/null +++ b/parts/off-canvas_crooked-river.php @@ -0,0 +1,35 @@ + + \ No newline at end of file diff --git a/parts/off-canvas_drawbridge.php b/parts/off-canvas_drawbridge.php new file mode 100644 index 0000000..82852a1 --- /dev/null +++ b/parts/off-canvas_drawbridge.php @@ -0,0 +1,35 @@ + + \ No newline at end of file diff --git a/parts/off-canvas_main.php b/parts/off-canvas_main.php new file mode 100644 index 0000000..532554b --- /dev/null +++ b/parts/off-canvas_main.php @@ -0,0 +1,35 @@ + + \ No newline at end of file diff --git a/parts/off-canvas_perry.php b/parts/off-canvas_perry.php new file mode 100644 index 0000000..e0b670b --- /dev/null +++ b/parts/off-canvas_perry.php @@ -0,0 +1,35 @@ + + \ No newline at end of file diff --git a/parts/off-canvas_pier.php b/parts/off-canvas_pier.php new file mode 100644 index 0000000..34ffd44 --- /dev/null +++ b/parts/off-canvas_pier.php @@ -0,0 +1,35 @@ + + \ No newline at end of file diff --git a/parts/off-canvas_pointer-boat.php b/parts/off-canvas_pointer-boat.php new file mode 100644 index 0000000..5e112c6 --- /dev/null +++ b/parts/off-canvas_pointer-boat.php @@ -0,0 +1,35 @@ + + \ No newline at end of file diff --git a/parts/off-canvas_vacation.php b/parts/off-canvas_vacation.php new file mode 100644 index 0000000..d2ed1c4 --- /dev/null +++ b/parts/off-canvas_vacation.php @@ -0,0 +1,35 @@ + + \ No newline at end of file diff --git a/parts/off-canvas_weathervane.php b/parts/off-canvas_weathervane.php new file mode 100644 index 0000000..d1790eb --- /dev/null +++ b/parts/off-canvas_weathervane.php @@ -0,0 +1,35 @@ + + diff --git a/parts/top-bar_about.php b/parts/top-bar_about.php index 628a1bd..3cbfabc 100644 --- a/parts/top-bar_about.php +++ b/parts/top-bar_about.php @@ -15,4 +15,5 @@ - \ No newline at end of file + + \ No newline at end of file diff --git a/parts/top-bar_art-gallery.php b/parts/top-bar_art-gallery.php index ba390fc..0228813 100644 --- a/parts/top-bar_art-gallery.php +++ b/parts/top-bar_art-gallery.php @@ -15,4 +15,5 @@ - \ No newline at end of file + + \ No newline at end of file diff --git a/parts/top-bar_bay-view.php b/parts/top-bar_bay-view.php index 8e67611..9d81a89 100644 --- a/parts/top-bar_bay-view.php +++ b/parts/top-bar_bay-view.php @@ -15,4 +15,5 @@ - \ No newline at end of file + + \ No newline at end of file diff --git a/parts/top-bar_crooked-river.php b/parts/top-bar_crooked-river.php index 7a11cfd..3473806 100644 --- a/parts/top-bar_crooked-river.php +++ b/parts/top-bar_crooked-river.php @@ -15,4 +15,5 @@ - \ No newline at end of file + + \ No newline at end of file