<?php
-
+require_once 'lib/menu-walker.php';
+require_once 'lib/navigation.php';
$ancestorId = null;
$includePages = array();
}
-
-/**
- * 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;
-}
-
-
-register_nav_menus(array(
- 'top-bar' => 'Site Navigation',
- //'mobile-off-canvas' => 'Mobile',
-// 'footer' => 'Footer'
-));
-
-if ( ! function_exists( 'michsci_top_bar' ) ) {
- function michsci_top_bar() {
- wp_nav_menu(array(
- 'container' => false, // remove nav container
- 'container_class' => '', // class of container
-
- 'items_wrap' => '<ul id="%1$s" class="%2$s"><li id="logo"><a href="' . get_bloginfo( 'url' ) . '"><img src="'.get_bloginfo('template_url').'/assets/michigan-scientific-logo.png"></a></li>%3$s</ul>',
-
- 'menu' => '', // menu name
- 'menu_class' => '', // adding custom nav class
- 'theme_location' => 'top-bar', // 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
- // limit the depth of the nav
- 'fallback_cb' => false, // fallback function (see below)
- 'walker' => new MichiganSci_Top_Bar_Walker()
- ));
- }
-}
-if ( ! class_exists( 'MichiganSci_Top_Bar_Walker()' ) ) :
-class MichiganSci_Top_Bar_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 ) ? 'has-dropdown' : '';
- $element->classes[] = ( $element->post_parent == 0 && $element->menu_order > 10 ) ? 'drop-right' : 'drop-left';
- parent::display_element( $element, $children_elements, $max_depth, $depth, $args, $output );
- }
- function start_lvl( &$output, $depth = 0, $args = array() ) {
- $output .= "\n<ul class=\"sub-menu dropdown\">\n";
- }
-}
-endif;
-
-/**
- * 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' => '',
- '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 '<ul'.(($class)?' class="'.$class.'"':'').'><!-- begin -->'."\n";
- foreach ($pages as $page) {
- $childs = get_pages('child_of=' . $page->ID);
- if (count($childs) > 0) {
- echo '<li class="has-dropdown">'."\n";
- echo '<a href="'.get_permalink($page->ID).'">'.$page->post_title.'</a>'."\n";
- echo glm_page_menu($page->ID, 'sub-menu dropdown');
- echo '</li>'."\n";
- } else {
- echo '<li';
- if ($page->ID == $frontPageId) {
- echo ' id="logo"';
- }
- echo '><a href="'.get_permalink($page->ID).'">';
- echo ($page->ID == $frontPageId) ? '<img src="'.get_bloginfo('template_url').'/assets/michigan-scientific-logo.png">': $page->post_title;
- echo '</a></li>'."\n";
- }
- }
- if ($parent == 0) {
- echo '<li ';
- echo 'id="search-icon"';
- echo '><a href="#">';
- echo '<img src="'.get_bloginfo('template_url').'/assets/Untitled-2.png">';
- echo '</a></li>'."\n";
- echo '<li ';
- echo '<form role="search" method="get" action="http://michsci.gaslightmedia.com/">';
- echo '<input class="search-input" placeholder="SEARCH" value="" name="s" type="text">';
- echo '</form>';
- echo '</li> ';
- }
- echo '</ul><!-- end -->'."\n";
-}
-
/**
* Return the client info option for the given key
*
}
}
-/**
- * glm_offcanvas_menu
- *
- * 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'
- ));
-}
-
+add_theme_support('custom-fieldss');
add_theme_support('post-thumbnails');
set_post_thumbnail_size(120, 100, true);
add_image_size('glm-block-thumb', 280, 186, true);
// echo '</div>';
-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 '<h1>'.get_the_title($ID).'</h1>';
- echo '<ul class="sidebar"><!-- begin -->'."\n";
- echo wp_list_pages( 'child_of='.$ID.'&title_li=&depth=1&echo=0');
- echo '</ul><!-- end -->'."\n";
-}
+
add_action('wp_enqueue_scripts', 'glm_site_scripts');
<link href='http://fonts.googleapis.com/css?family=Crimson+Text:600italic' rel='stylesheet' type='text/css'>
<?php wp_head(); ?>
</head>
- <body>
+ <body <?php body_class( ); ?>>
<div class="off-canvas-wrap" data-offcanvas>
<div class="inner-wrap">
<header id="top">
<div class="row">
- <div class="small-11 small-centered text-center columns show-for-medium-down">
- <a href="<?php bloginfo('url');?>"><img src="<?php echo get_template_directory_uri(); ?>/assets/michigan-scientific-logo.png"></a>
- </div>
- </div>
- <div class="row collapse sec-nav show-for-medium-up">
- <div class="medium-6 columns right">
- <ul>
- <li><a href="<?php bloginfo('url'); ?>/jobs">Jobs</a></li>
- <li><a href="<?php bloginfo('url'); ?>/faq">FAQ</a></li>
- <li><a href="<?php bloginfo('url'); ?>/site-map">Site Map</a></li>
- <li class="social"><a target="_blank" href="https://www.facebook.com/MichiganScientificCorporation"><img src="<?php echo get_template_directory_uri(); ?>/assets/facebook-icon.jpg"></a></li>
- <li class="social"><a target="_blank" href="https://www.linkedin.com/company/michigan-scientific-corp"><img src="<?php echo get_template_directory_uri(); ?>/assets/linkedin-icon.jpg"></a></li>
- <li class="social"><a target="_blank" href="https://twitter.com/michsci"><img src="<?php echo get_template_directory_uri(); ?>/assets/twitter-icon.jpg"></a></li>
- </ul>
+ <div class="small-11 small-centered text-center columns">
+ <?php get_custom_logo($blog_id = 0 );?>
+ <?php the_custom_logo($blog_id = 0 );?>
+ <?php
+ if ( is_front_page() && is_home() ) : ?>
+ <h1 class="site-title"><a href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a></h1>
+ <?php else : ?>
+ <h1 class="site-title"><a href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a></h1>
+ <?php endif;
+ $description = get_bloginfo( 'description', 'display' );
+ if ( $description || is_customize_preview() ) : ?>
+ <h3 class="site-description"><?php echo $description; ?></h3>
+ <?php endif;
+ ?>
</div>
</div>
<div class="row collapse">