From 541cf0613bf221bb0448b4855774ea79fa11614b Mon Sep 17 00:00:00 2001 From: Steve Sutton Date: Tue, 17 Nov 2015 09:54:16 -0500 Subject: [PATCH] Working on glm blocks and removing extra theme pages index.php still has stuff from Emmet County EMS which should never be in themes. --- functions.php | 666 +------------------------------------------ index.php | 81 +++--- lib/menu-walker.php | 286 +++++++++++++++++++ lib/navigation.php | 307 ++++++++++++++++++++ page.php | 40 --- page_weathervane.php | 2 +- parts/glm-blocks.php | 13 +- parts/slide-show.php | 1 + 8 files changed, 647 insertions(+), 749 deletions(-) create mode 100644 lib/menu-walker.php create mode 100644 lib/navigation.php delete mode 100644 page.php diff --git a/functions.php b/functions.php index 0a48815..5acb3b3 100644 --- a/functions.php +++ b/functions.php @@ -1,375 +1,8 @@ __('Right Sidebar'), - 'id' => 'sidebar-r', - 'description' => __('Appears in Right Sidebar') - )); - //register_sidebar(array( - // 'name' => __('Footer'), - // 'id' => 'sidebar-f', - // 'description' => __('Appears in Footer Area') - //)); - } - -} - -/** - * get_menu_options - * - * Grab the menu options from the theme.ini file - */ -function glm_get_menu_options() -{ - static $menu_options; - $themeConfig = get_template_directory() . '/theme.ini'; - - if (!$menu_options && is_file($themeConfig)) { - $menu_options = parse_ini_file($themeConfig, true); - } - return $menu_options; -} - -/** - * glm_page_menu - * - * Grab the top level pages and their sub pages as the main navigation - */ -function glm_page_menu($parent = 0, $class = '') -{ - $menuConfig = glm_get_menu_options(); - $frontPageId = get_option('page_on_front'); - $parents = array(); - $args = array( - 'post_type' => 'page', - 'parent' => $parent, - 'number' => '', - 'exclude' => $frontPageId, - 'post_status' => 'publish', - 'sort_order' => 'asc', - 'sort_column' => 'menu_order' - ); - if ($parent == 0 && $menuConfig['menu_options']['main_level_pages']) { - $args['include'] = $menuConfig['menu_options']['main_level_pages']; - } - $pages = get_pages($args); - echo ''."\n"; - foreach ($pages as $page) { - $childs = get_pages('child_of=' . $page->ID); - if (count($childs) > 0) { - echo '
  • '."\n"; - echo ''.$page->post_title.''."\n"; - echo glm_page_menu($page->ID, 'sub-menu dropdown'); - echo '
  • '."\n"; - } else { - echo '
  • '.$page->post_title.'
  • '."\n"; - } - } - echo ''."\n"; -} - -register_nav_menus(array( - 'top-bar' => 'Site Navigation', -// 'mobile-off-canvas' => 'Mobile', - 'property-bar' => 'Properties Navigation', - 'property-mobile' => 'Mobile Property Navigation', - 'art-bar' => 'Art Gallery Navigation', - 'bay-bar' => 'Bay View Inn Navitgation', - 'river-bar' => 'Crooked River Lodge Navigation', - 'bridge-bar' => 'Drawbridge Bistro Navigation', - 'perry-bar' => 'Perry Hotel Navigation', - 'pier-bar' => 'Pier Restaurant Navigation', - 'boat-bar' => 'Pointer Boat Navigation', - 'vacation-bar' => 'Vacation Rental Navigation', - 'weathervane-bar' => 'Weathervane Restaurant Navigation', - 'about-bar' => 'About Navigation', -// 'footer' => 'Footer' -)); - -if ( ! function_exists( 'feature_top_bar' ) ) { - function feature_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 Feature_Top_Bar_Walker() - )); - } -} -if ( ! function_exists( 'property_top_bar' ) ) { - function property_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' => 'property-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 Feature_Top_Bar_Walker() - )); - } -} -if ( ! function_exists( 'bay_top_bar' ) ) { - function bay_top_bar() { - wp_nav_menu(array( - 'container' => false, // remove nav container - 'container_class' => '', // class of container - 'menu' => '', // menu name - 'menu_class' => 'bay-view', // adding custom nav class - 'theme_location' => 'bay-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 Feature_Top_Bar_Walker() - )); - } -} -if ( ! function_exists( 'art_top_bar' ) ) { - function art_top_bar() { - wp_nav_menu(array( - 'container' => false, // remove nav container - 'container_class' => '', // class of container - 'menu' => '', // menu name - 'menu_class' => 'art-gallery', // adding custom nav class - 'theme_location' => 'art-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 Feature_Top_Bar_Walker() - )); - } -} -if ( ! function_exists( 'river_top_bar' ) ) { - function river_top_bar() { - wp_nav_menu(array( - 'container' => false, // remove nav container - 'container_class' => '', // class of container - 'menu' => '', // menu name - 'menu_class' => 'crooked-river', // adding custom nav class - 'theme_location' => 'river-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 Feature_Top_Bar_Walker() - )); - } -} -if ( ! function_exists( 'bridge_top_bar' ) ) { - function bridge_top_bar() { - wp_nav_menu(array( - 'container' => false, // remove nav container - 'container_class' => '', // class of container - 'menu' => '', // menu name - 'menu_class' => 'drawbridge', // adding custom nav class - 'theme_location' => 'bridge-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 Feature_Top_Bar_Walker() - )); - } -} -if ( ! function_exists( 'perry_top_bar' ) ) { - function perry_top_bar() { - wp_nav_menu(array( - 'container' => false, // remove nav container - 'container_class' => '', // class of container - 'menu' => '', // menu name - 'menu_class' => 'perry-hotel', // adding custom nav class - 'theme_location' => 'perry-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 Feature_Top_Bar_Walker() - )); - } -} -if ( ! function_exists( 'pier_top_bar' ) ) { - function pier_top_bar() { - wp_nav_menu(array( - 'container' => false, // remove nav container - 'container_class' => '', // class of container - 'menu' => '', // menu name - 'menu_class' => 'pier-restuarant', // adding custom nav class - 'theme_location' => 'pier-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 Feature_Top_Bar_Walker() - )); - } -} -if ( ! function_exists( 'boat_top_bar' ) ) { - function boat_top_bar() { - wp_nav_menu(array( - 'container' => false, // remove nav container - 'container_class' => '', // class of container - 'menu' => '', // menu name - 'menu_class' => 'pointer-boat', // adding custom nav class - 'theme_location' => 'boat-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 Feature_Top_Bar_Walker() - )); - } -} -if ( ! function_exists( 'vacation_top_bar' ) ) { - function vacation_top_bar() { - wp_nav_menu(array( - 'container' => false, // remove nav container - 'container_class' => '', // class of container - 'menu' => '', // menu name - 'menu_class' => 'vacation-rental', // adding custom nav class - 'theme_location' => 'vacation-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 Feature_Top_Bar_Walker() - )); - } -} -if ( ! function_exists( 'weathervane_top_bar' ) ) { - function weathervane_top_bar() { - wp_nav_menu(array( - 'container' => false, // remove nav container - 'container_class' => '', // class of container - 'menu' => '', // menu name - 'menu_class' => 'weathervane', // adding custom nav class - 'theme_location' => 'weathervane-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 Feature_Top_Bar_Walker() - )); - } -} -if ( ! function_exists( 'about_top_bar' ) ) { - function about_top_bar() { - wp_nav_menu(array( - 'container' => false, // remove nav container - 'container_class' => '', // class of container - 'menu' => '', // menu name - 'menu_class' => 'about', // adding custom nav class - 'theme_location' => 'about-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 Feature_Top_Bar_Walker() - )); - } -} - -if ( ! class_exists( 'Feature_Top_Bar_Walker' ) ) : -class Feature_Top_Bar_Walker extends Walker_Nav_Menu { - - function display_element( $element, &$children_elements, $max_depth, $depth = 0, $args, &$output ) { - static $mainLevelCounter; - if ($depth == 0) { - ++$mainLevelCounter; - } - $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 ) ? 'has-dropdown' : ''; - $element->classes[] = ( $element->post_parent == 0 && $mainLevelCounter < 3 ) ? '' : 'drop-left'; - 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 ); -// -// // Insert style to display page's thumbnail -// $item_style = ''; -// if ($depth == 0 && has_post_thumbnail((int)$object->object_id)) { -// $thumbnail = wp_get_attachment_image_src(get_post_thumbnail_id((int)$object->object_id), 'bpla-drop-down'); -// //$item_style .= ""; -// } -// //$output .= ( 0 == $depth ) ? '
  • ' : ''; -// $classes = empty( $object->classes ) ? array() : (array) $object->classes; -// if ( in_array( 'label', $classes ) ) { -// //$output .= '
  • '; -// $item_html = preg_replace( '/]*>(.*)<\/a>/iU', '', $item_html ); -// } -// if ( in_array( 'divider', $classes ) ) { -// $item_html = preg_replace( '/]*>( .* )<\/a>/iU', '', $item_html ); -// } -// if ($item_style) { -// $output .= $item_style; -// } -// if ($depth == 0 && has_post_thumbnail((int)$object->object_id) && $object->has_children) { -// $thumbnail = wp_get_attachment_image_src(get_post_thumbnail_id((int)$object->object_id), 'bpla-drop-down'); -// $item_html .= ''; -// //$item_html .= '
    ' . print_r($object, true) . '
    '; -// } -// $output .= $item_html; -// } - - function start_lvl( &$output, $depth = 0, $args = array() ) { - if ($depth == 0) { - $output .= "\n
      \n"; -// $output .= "\n
    • "; -// $output .= "
    • \n"; -// $output .= "\n\n"; - - } - } - -} -endif; /** * Return the client info option for the given key * @@ -394,268 +27,6 @@ if (!function_exists('glm_get_clientinfo_option')) { } } -/** - * glm_offcanvas_menu - * - * Generate the list of pages as nested ul li list - */ - -if ( ! function_exists( 'feature_mobile_off_canvas' ) ) { - function feature_mobile_off_canvas() { - echo '
        '; - echo '
      • Home
      • '; - wp_nav_menu(array( - 'container' => false, // remove nav container - 'container_class' => '', // class of container - 'menu' => '', // menu name - 'menu_class' => 'off-canvas-list', // 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' => 5, // limit the depth of the nav - 'fallback_cb' => false, // fallback function (see below) - 'items_wrap' => '%3$s', - 'walker' => new Feature_Offcanvas_Walker() - )); - echo '
      '; - } -} -if ( ! function_exists( 'bay_mobile_off_canvas' ) ) { - function bay_mobile_off_canvas() { - wp_nav_menu(array( - 'container' => false, // remove nav container - 'container_class' => '', // class of container - 'menu' => '', // menu name - 'menu_class' => 'bay-view', // adding custom nav class - 'theme_location' => 'bay-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 Feature_Offcanvas_Walker() - )); - } -} -if ( ! function_exists( 'art_mobile_off_canvas' ) ) { - function art_mobile_off_canvas() { - wp_nav_menu(array( - 'container' => false, // remove nav container - 'container_class' => '', // class of container - 'menu' => '', // menu name - 'menu_class' => 'art-gallery', // adding custom nav class - 'theme_location' => 'art-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 Feature_Offcanvas_Walker() - )); - } -} -if ( ! function_exists( 'river_mobile_off_canvas' ) ) { - function river_mobile_off_canvas() { - wp_nav_menu(array( - 'container' => false, // remove nav container - 'container_class' => '', // class of container - 'menu' => '', // menu name - 'menu_class' => 'crooked-river', // adding custom nav class - 'theme_location' => 'river-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 Feature_Offcanvas_Walker() - )); - } -} -if ( ! function_exists( 'bridge_mobile_off_canvas' ) ) { - function bridge_mobile_off_canvas() { - wp_nav_menu(array( - 'container' => false, // remove nav container - 'container_class' => '', // class of container - 'menu' => '', // menu name - 'menu_class' => 'drawbridge', // adding custom nav class - 'theme_location' => 'bridge-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 Feature_Offcanvas_Walker() - )); - } -} -if ( ! function_exists( 'perry_mobile_off_canvas' ) ) { - function perry_mobile_off_canvas() { - wp_nav_menu(array( - 'container' => false, // remove nav container - 'container_class' => '', // class of container - 'menu' => '', // menu name - 'menu_class' => 'perry-hotel', // adding custom nav class - 'theme_location' => 'perry-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 Feature_Offcanvas_Walker() - )); - } -} -if ( ! function_exists( 'pier_mobile_off_canvas' ) ) { - function pier_mobile_off_canvas() { - wp_nav_menu(array( - 'container' => false, // remove nav container - 'container_class' => '', // class of container - 'menu' => '', // menu name - 'menu_class' => 'pier-restuarant', // adding custom nav class - 'theme_location' => 'pier-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 Feature_Offcanvas_Walker() - )); - } -} -if ( ! function_exists( 'boat_mobile_off_canvas' ) ) { - function boat_mobile_off_canvas() { - wp_nav_menu(array( - 'container' => false, // remove nav container - 'container_class' => '', // class of container - 'menu' => '', // menu name - 'menu_class' => 'pointer-boat', // adding custom nav class - 'theme_location' => 'boat-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 Feature_Offcanvas_Walker() - )); - } -} -if ( ! function_exists( 'vacation_mobile_off_canvas' ) ) { - function vacation_mobile_off_canvas() { - wp_nav_menu(array( - 'container' => false, // remove nav container - 'container_class' => '', // class of container - 'menu' => '', // menu name - 'menu_class' => 'vacation-rental', // adding custom nav class - 'theme_location' => 'vacation-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 Feature_Offcanvas_Walker() - )); - } -} -if ( ! function_exists( 'weathervane_mobile_off_canvas' ) ) { - function weathervane_mobile_off_canvas() { - wp_nav_menu(array( - 'container' => false, // remove nav container - 'container_class' => '', // class of container - 'menu' => '', // menu name - 'menu_class' => 'weathervane', // adding custom nav class - 'theme_location' => 'weathervane-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 Feature_Offcanvas_Walker() - )); - } -} -if ( ! function_exists( 'about_mobile_off_canvas' ) ) { - function about_mobile_off_canvas() { - wp_nav_menu(array( - 'container' => false, // remove nav container - 'container_class' => '', // class of container - 'menu' => '', // menu name - 'menu_class' => 'about', // adding custom nav class - 'theme_location' => 'about-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 Feature_Offcanvas_Walker() - )); - } -} -if ( ! function_exists( 'property_mobile_off_canvas' ) ) { - function property_mobile_off_canvas() { - wp_nav_menu(array( - 'container' => false, // remove nav container - 'container_class' => '', // class of container - 'menu' => '', // menu name - 'menu_class' => 'property-list', // adding custom nav class - 'theme_location' => 'property-mobile', // 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 Feature_Offcanvas_Walker() - )); - } -} -if ( ! class_exists( 'Feature_Offcanvas_Walker' ) ) : -class Feature_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
        \n"; - } - - function end_lvl(&$output, $depth = 0, $args = array()){ - $output .= '
      '; - } - -} -endif; - add_theme_support('post-thumbnails'); set_post_thumbnail_size(120, 100, true); /** @@ -678,7 +49,7 @@ function glm_site_scripts() true ); wp_enqueue_script('jquery-ui-datepicker'); - wp_enqueue_style('jquery-style', '//ajax.googleapis.com/ajax/libs/jqueryui/1.8.2/themes/smoothness/jquery-ui.css'); + wp_enqueue_style('jquery-style', '//ajax.googleapis.com/ajax/libs/jqueryui/1.8.2/themes/smoothness/jquery-ui.css'); if(is_front_page()) { } @@ -704,37 +75,6 @@ function glm_get_header() { echo ''; echo ''; } - -// // The code below is useful when you want the image to resize to -// if (has_post_thumbnail()) { -// $image_data = wp_get_attachment_image_src(get_post_thumbnail_id(), "full"); -// echo ''; -// } else { -// echo ''; -// } -// echo '
      '; -// echo '
      '; -// echo '
      '; -// echo '
      '; - - -function glm_side_menu() { - global $post; - $parents = get_post_ancestors($post->ID); - $id = ($parents) ? $parents[count($parents)-1]: $post->ID; - $parent = get_page( $id ); - if ($id == 0) { - $ID = $post->ID; - } else { - $ID = $parent->ID; - } - echo '

      '.get_the_title($ID).'

      '; - echo ''."\n"; -} - - add_action('wp_enqueue_scripts', 'glm_site_scripts'); diff --git a/index.php b/index.php index 872cb50..dc27734 100644 --- a/index.php +++ b/index.php @@ -1,47 +1,40 @@ -
      -
      -
      - -
      -

      Img description here.

      +
      + + + +
      +
      +
      +
      +
      -
      -
      -
      -
      -
      -

      If this is an emergency, please call 9-1-1

      +
      +
      + + + +

      + +
      +
      + +
      -
      -
      -
      - -

      State Licensed

      -

      Just 74 days after the Emmet County Board of Commissioners gave their approval for the County to assume EMS services, the state has put its stamp of approval on the operations as well.

      Read More... -
      -
      - -

      New M-119 Location

      -

      Emmet County continues to move forward on its new facility to house the ambulances and related equipment currently being constructed on M-119, near Pleasantview Road.

      Read More... -
      -
      - -

      New Rig

      -

      Progress is being made in Emmet County’s efforts to provide ambulance services in Northwest Michigan, with the arrival of one of several new ambulances Oct. 9 in Petoskey.

      Read More... -
      -
      -
      -
      -

      Title Here

      -

      Doluptur sinis nihic teturitat id que prorro incturem dem volorit atiume ped mi, cusci rest voluptatium qui consedi odigeni musdae. Ipsa suntum quaecab il explia voluptam harum conet harupturit pratio que cum et litium lis sernatur sunt, ommolup tatiam hillam ratur? Acea verum in natet laut id moloremped et volupic iisqui ressin cus, venditia corum, con re sunt.

      -Quias eos et porerciis in nienihi lligeni ssiminu sapicienet volut a amus di cullat pa sin re pre voluptas adicitibus peris cum anti idem eiusani moluptatium aria doloribus, cus.

      -Abores eossumq uuntissum apienis doluptae quasit lam, nonseque nus exce rrum commoluptat quas volorempos quassu magnatium nonsect inverfe ratassint quaerro viderro renihicti apid esto blaciet eum quae ius magnihi lluptas que volupt quid ute porem.

      -
      -
      -

      EMS Events

      - -
      -
      -
      - +
      + \ No newline at end of file diff --git a/lib/menu-walker.php b/lib/menu-walker.php new file mode 100644 index 0000000..2682bd7 --- /dev/null +++ b/lib/menu-walker.php @@ -0,0 +1,286 @@ +has_children = ! empty( $children_elements[ $element->ID ] ); + $element->classes[] = ( $element->current || $element->current_item_ancestor ) ? 'active' : ''; + $element->classes[] = ( $element->has_children && 1 !== $max_depth ) ? 'has-dropdown' : ''; + $element->classes[] = ( $element->post_parent == 0 && $mainLevelCounter < 3 ) ? '' : 'drop-left'; + parent::display_element( $element, $children_elements, $max_depth, $depth, $args, $output ); + } + + function start_lvl( &$output, $depth = 0, $args = array() ) { + if ($depth == 0) { + $output .= "\n
        \n"; + } + } + +} +endif; +/** + * glm_offcanvas_menu + * + * Generate the list of pages as nested ul li list + */ + +if ( ! function_exists( 'feature_mobile_off_canvas' ) ) { + function feature_mobile_off_canvas() { + echo '
          '; + echo '
        • Home
        • '; + wp_nav_menu(array( + 'container' => false, // remove nav container + 'container_class' => '', // class of container + 'menu' => '', // menu name + 'menu_class' => 'off-canvas-list', // 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' => 5, // limit the depth of the nav + 'fallback_cb' => false, // fallback function (see below) + 'items_wrap' => '%3$s', + 'walker' => new Feature_Offcanvas_Walker() + )); + echo '
        '; + } +} +if ( ! function_exists( 'bay_mobile_off_canvas' ) ) { + function bay_mobile_off_canvas() { + wp_nav_menu(array( + 'container' => false, // remove nav container + 'container_class' => '', // class of container + 'menu' => '', // menu name + 'menu_class' => 'bay-view', // adding custom nav class + 'theme_location' => 'bay-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 Feature_Offcanvas_Walker() + )); + } +} +if ( ! function_exists( 'art_mobile_off_canvas' ) ) { + function art_mobile_off_canvas() { + wp_nav_menu(array( + 'container' => false, // remove nav container + 'container_class' => '', // class of container + 'menu' => '', // menu name + 'menu_class' => 'art-gallery', // adding custom nav class + 'theme_location' => 'art-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 Feature_Offcanvas_Walker() + )); + } +} +if ( ! function_exists( 'river_mobile_off_canvas' ) ) { + function river_mobile_off_canvas() { + wp_nav_menu(array( + 'container' => false, // remove nav container + 'container_class' => '', // class of container + 'menu' => '', // menu name + 'menu_class' => 'crooked-river', // adding custom nav class + 'theme_location' => 'river-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 Feature_Offcanvas_Walker() + )); + } +} +if ( ! function_exists( 'bridge_mobile_off_canvas' ) ) { + function bridge_mobile_off_canvas() { + wp_nav_menu(array( + 'container' => false, // remove nav container + 'container_class' => '', // class of container + 'menu' => '', // menu name + 'menu_class' => 'drawbridge', // adding custom nav class + 'theme_location' => 'bridge-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 Feature_Offcanvas_Walker() + )); + } +} +if ( ! function_exists( 'perry_mobile_off_canvas' ) ) { + function perry_mobile_off_canvas() { + wp_nav_menu(array( + 'container' => false, // remove nav container + 'container_class' => '', // class of container + 'menu' => '', // menu name + 'menu_class' => 'perry-hotel', // adding custom nav class + 'theme_location' => 'perry-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 Feature_Offcanvas_Walker() + )); + } +} +if ( ! function_exists( 'pier_mobile_off_canvas' ) ) { + function pier_mobile_off_canvas() { + wp_nav_menu(array( + 'container' => false, // remove nav container + 'container_class' => '', // class of container + 'menu' => '', // menu name + 'menu_class' => 'pier-restuarant', // adding custom nav class + 'theme_location' => 'pier-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 Feature_Offcanvas_Walker() + )); + } +} +if ( ! function_exists( 'boat_mobile_off_canvas' ) ) { + function boat_mobile_off_canvas() { + wp_nav_menu(array( + 'container' => false, // remove nav container + 'container_class' => '', // class of container + 'menu' => '', // menu name + 'menu_class' => 'pointer-boat', // adding custom nav class + 'theme_location' => 'boat-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 Feature_Offcanvas_Walker() + )); + } +} +if ( ! function_exists( 'vacation_mobile_off_canvas' ) ) { + function vacation_mobile_off_canvas() { + wp_nav_menu(array( + 'container' => false, // remove nav container + 'container_class' => '', // class of container + 'menu' => '', // menu name + 'menu_class' => 'vacation-rental', // adding custom nav class + 'theme_location' => 'vacation-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 Feature_Offcanvas_Walker() + )); + } +} +if ( ! function_exists( 'weathervane_mobile_off_canvas' ) ) { + function weathervane_mobile_off_canvas() { + wp_nav_menu(array( + 'container' => false, // remove nav container + 'container_class' => '', // class of container + 'menu' => '', // menu name + 'menu_class' => 'weathervane', // adding custom nav class + 'theme_location' => 'weathervane-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 Feature_Offcanvas_Walker() + )); + } +} +if ( ! function_exists( 'about_mobile_off_canvas' ) ) { + function about_mobile_off_canvas() { + wp_nav_menu(array( + 'container' => false, // remove nav container + 'container_class' => '', // class of container + 'menu' => '', // menu name + 'menu_class' => 'about', // adding custom nav class + 'theme_location' => 'about-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 Feature_Offcanvas_Walker() + )); + } +} +if ( ! function_exists( 'property_mobile_off_canvas' ) ) { + function property_mobile_off_canvas() { + wp_nav_menu(array( + 'container' => false, // remove nav container + 'container_class' => '', // class of container + 'menu' => '', // menu name + 'menu_class' => 'property-list', // adding custom nav class + 'theme_location' => 'property-mobile', // 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 Feature_Offcanvas_Walker() + )); + } +} +if ( ! class_exists( 'Feature_Offcanvas_Walker' ) ) : +class Feature_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
          \n"; + } + + function end_lvl(&$output, $depth = 0, $args = array()){ + $output .= '
        '; + } + +} +endif; +?> diff --git a/lib/navigation.php b/lib/navigation.php new file mode 100644 index 0000000..d743fc2 --- /dev/null +++ b/lib/navigation.php @@ -0,0 +1,307 @@ + 'Site Navigation', +// 'mobile-off-canvas' => 'Mobile', + 'property-bar' => 'Properties Navigation', + 'property-mobile' => 'Mobile Property Navigation', + 'art-bar' => 'Art Gallery Navigation', + 'bay-bar' => 'Bay View Inn Navitgation', + 'river-bar' => 'Crooked River Lodge Navigation', + 'bridge-bar' => 'Drawbridge Bistro Navigation', + 'perry-bar' => 'Perry Hotel Navigation', + 'pier-bar' => 'Pier Restaurant Navigation', + 'boat-bar' => 'Pointer Boat Navigation', + 'vacation-bar' => 'Vacation Rental Navigation', + 'weathervane-bar' => 'Weathervane Restaurant Navigation', + 'about-bar' => 'About Navigation', +// 'footer' => 'Footer' +)); +$ancestorId = null; +$includePages = array(); +$frontPageId = get_option('page_on_front'); + +/** + * get_menu_options + * + * Grab the menu options from the theme.ini file + */ +function glm_get_menu_options() +{ + static $menu_options; + $themeConfig = get_template_directory() . '/theme.ini'; + + if (!$menu_options && is_file($themeConfig)) { + $menu_options = parse_ini_file($themeConfig, true); + } + return $menu_options; +} +/** + * glm_page_menu + * + * Grab the top level pages and their sub pages as the main navigation + */ +function glm_page_menu($parent = 0, $class = '') +{ + $menuConfig = glm_get_menu_options(); + $frontPageId = get_option('page_on_front'); + $parents = array(); + $args = array( + 'post_type' => 'page', + 'parent' => $parent, + 'number' => '', + 'exclude' => $frontPageId, + 'post_status' => 'publish', + 'sort_order' => 'asc', + 'sort_column' => 'menu_order' + ); + if ($parent == 0 && $menuConfig['menu_options']['main_level_pages']) { + $args['include'] = $menuConfig['menu_options']['main_level_pages']; + } + $pages = get_pages($args); + echo ''."\n"; + foreach ($pages as $page) { + $childs = get_pages('child_of=' . $page->ID); + if (count($childs) > 0) { + echo '
      • '."\n"; + echo ''.$page->post_title.''."\n"; + echo glm_page_menu($page->ID, 'sub-menu dropdown'); + echo '
      • '."\n"; + } else { + echo '
      • '.$page->post_title.'
      • '."\n"; + } + } + echo '
      '."\n"; +} +if ( ! function_exists( 'feature_top_bar' ) ) { + function feature_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 Feature_Top_Bar_Walker() + )); + } +} +if ( ! function_exists( 'property_top_bar' ) ) { + function property_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' => 'property-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 Feature_Top_Bar_Walker() + )); + } +} +if ( ! function_exists( 'bay_top_bar' ) ) { + function bay_top_bar() { + wp_nav_menu(array( + 'container' => false, // remove nav container + 'container_class' => '', // class of container + 'menu' => '', // menu name + 'menu_class' => 'bay-view', // adding custom nav class + 'theme_location' => 'bay-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 Feature_Top_Bar_Walker() + )); + } +} +if ( ! function_exists( 'art_top_bar' ) ) { + function art_top_bar() { + wp_nav_menu(array( + 'container' => false, // remove nav container + 'container_class' => '', // class of container + 'menu' => '', // menu name + 'menu_class' => 'art-gallery', // adding custom nav class + 'theme_location' => 'art-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 Feature_Top_Bar_Walker() + )); + } +} +if ( ! function_exists( 'river_top_bar' ) ) { + function river_top_bar() { + wp_nav_menu(array( + 'container' => false, // remove nav container + 'container_class' => '', // class of container + 'menu' => '', // menu name + 'menu_class' => 'crooked-river', // adding custom nav class + 'theme_location' => 'river-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 Feature_Top_Bar_Walker() + )); + } +} +if ( ! function_exists( 'bridge_top_bar' ) ) { + function bridge_top_bar() { + wp_nav_menu(array( + 'container' => false, // remove nav container + 'container_class' => '', // class of container + 'menu' => '', // menu name + 'menu_class' => 'drawbridge', // adding custom nav class + 'theme_location' => 'bridge-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 Feature_Top_Bar_Walker() + )); + } +} +if ( ! function_exists( 'perry_top_bar' ) ) { + function perry_top_bar() { + wp_nav_menu(array( + 'container' => false, // remove nav container + 'container_class' => '', // class of container + 'menu' => '', // menu name + 'menu_class' => 'perry-hotel', // adding custom nav class + 'theme_location' => 'perry-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 Feature_Top_Bar_Walker() + )); + } +} +if ( ! function_exists( 'pier_top_bar' ) ) { + function pier_top_bar() { + wp_nav_menu(array( + 'container' => false, // remove nav container + 'container_class' => '', // class of container + 'menu' => '', // menu name + 'menu_class' => 'pier-restuarant', // adding custom nav class + 'theme_location' => 'pier-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 Feature_Top_Bar_Walker() + )); + } +} +if ( ! function_exists( 'boat_top_bar' ) ) { + function boat_top_bar() { + wp_nav_menu(array( + 'container' => false, // remove nav container + 'container_class' => '', // class of container + 'menu' => '', // menu name + 'menu_class' => 'pointer-boat', // adding custom nav class + 'theme_location' => 'boat-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 Feature_Top_Bar_Walker() + )); + } +} +if ( ! function_exists( 'vacation_top_bar' ) ) { + function vacation_top_bar() { + wp_nav_menu(array( + 'container' => false, // remove nav container + 'container_class' => '', // class of container + 'menu' => '', // menu name + 'menu_class' => 'vacation-rental', // adding custom nav class + 'theme_location' => 'vacation-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 Feature_Top_Bar_Walker() + )); + } +} +if ( ! function_exists( 'weathervane_top_bar' ) ) { + function weathervane_top_bar() { + wp_nav_menu(array( + 'container' => false, // remove nav container + 'container_class' => '', // class of container + 'menu' => '', // menu name + 'menu_class' => 'weathervane', // adding custom nav class + 'theme_location' => 'weathervane-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 Feature_Top_Bar_Walker() + )); + } +} +if ( ! function_exists( 'about_top_bar' ) ) { + function about_top_bar() { + wp_nav_menu(array( + 'container' => false, // remove nav container + 'container_class' => '', // class of container + 'menu' => '', // menu name + 'menu_class' => 'about', // adding custom nav class + 'theme_location' => 'about-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 Feature_Top_Bar_Walker() + )); + } +} +function glm_side_menu() { + global $post; + $parents = get_post_ancestors($post->ID); + $id = ($parents) ? $parents[count($parents)-1]: $post->ID; + $parent = get_page( $id ); + if ($id == 0) { + $ID = $post->ID; + } else { + $ID = $parent->ID; + } + echo '

      '.get_the_title($ID).'

      '; + echo ''."\n"; +} +?> diff --git a/page.php b/page.php deleted file mode 100644 index dc27734..0000000 --- a/page.php +++ /dev/null @@ -1,40 +0,0 @@ - -
      - - - -
      -
      -
      -
      - -
      -
      -
      - - - -

      - -
      -
      - -
      -
      -
      - \ No newline at end of file diff --git a/page_weathervane.php b/page_weathervane.php index 84a0da9..7ab5059 100644 --- a/page_weathervane.php +++ b/page_weathervane.php @@ -1,6 +1,6 @@ diff --git a/parts/glm-blocks.php b/parts/glm-blocks.php index 78c59b5..a32e453 100644 --- a/parts/glm-blocks.php +++ b/parts/glm-blocks.php @@ -1,5 +1,14 @@ - + +
      @@ -18,7 +27,9 @@

      post_content . $block->post_excerpt;?>

      + url):?> find out more... +
      diff --git a/parts/slide-show.php b/parts/slide-show.php index b786943..c31165a 100644 --- a/parts/slide-show.php +++ b/parts/slide-show.php @@ -1,6 +1,7 @@ '; echo do_shortcode("[metaslider id=75]"); + echo do_shortcode("[metaslider id=48]"); echo '
      '; echo '
      '; echo '
      '; -- 2.17.1