false, // remove nav container 'container_class' => 'menu clearfix', // class of container (should you choose to use it) 'menu' => __( 'The Main Menu', 'bonestheme' ), // nav name 'menu_class' => 'top-nav clearfix', // adding custom nav class 'theme_location' => 'main-nav', // where it's located in the theme 'before' => '', // before the menu 'after' => '', // after the menu 'link_before' => '', // before each link 'link_after' => '', // after each link 'depth' => 0, // limit the depth of the nav 'items_wrap' => '
', 'walker' => new eo_Walker_Nav_Menu(), // 'show_home' => true, 'fallback_cb' => 'eo_main_nav_fallback' // fallback function )); } } if( $eo_options['nav_select_menu'] == "1" ) { require_once(get_template_directory().'/inc/core/mobile_menu_nav_walker.php'); // _custom nav walker require_once(get_template_directory().'/inc/core/mobile_menu_page_walker.php'); // _custom page walker function eo_mobile_nav_menu() { wp_nav_menu(array( 'container' => false, // remove nav container 'container_class' => 'menu clearfix', // class of container (should you choose to use it) 'menu' => __( 'The Main Menu', 'bonestheme' ), // nav name 'menu_class' => 'mobile-top-nav clearfix', // adding custom nav class 'theme_location' => 'main-nav', // where it's located in the theme 'before' => '', // before the menu 'after' => '', // after the menu 'link_before' => '', // before each link 'link_after' => '', // after each link 'depth' => 0, // limit the depth of the nav 'items_wrap' => '', 'walker' => new eo_mobile_Walker_Nav_Menu(), // 'show_home' => true, 'fallback_cb' => 'eo_mobile_nav_fallback' // fallback function )); } function eo_mobile_page_menu( $args = array() ) { $defaults = array('sort_column' => 'menu_order, post_title', 'menu_class' => 'menu', 'echo' => true, 'link_before' => '', 'link_after' => ''); $args = wp_parse_args( $args, $defaults ); $args = apply_filters( 'wp_page_menu_args', $args ); $menu = ''; $list_args = $args; // var_dump($args); // Show Home in the menu if ( ! empty($args['show_home']) ) { if ( true === $args['show_home'] || '1' === $args['show_home'] || 1 === $args['show_home'] ) $text = __('Home'); else $text = $args['show_home']; $class = ''; if ( is_front_page() && !is_paged() ) $class = ' class="current_page_item active"'; $slctd = ' selected="selected"'; $menu .= ''; // If the front page is a page, add it to the exclude list if (get_option('show_on_front') == 'page') { if ( !empty( $list_args['exclude'] ) ) { $list_args['exclude'] .= ','; } else { $list_args['exclude'] = ''; } $list_args['exclude'] .= get_option('page_on_front'); } } $list_args['echo'] = false; $list_args['title_li'] = ''; $list_args['walker'] = new eo_mobile_Walker_Page(); $menu .= str_replace( array( "\r", "\n", "\t" ), '', wp_list_pages($list_args) ); //var_dump($menu); if ( $menu ) $select_cl = "eo-mobile-select-nav"; if ( isset($_GET[$select_cl]) ) { $get_selected = $_GET[$select_cl]; header('Location: '.$get_selected); } $menu = ''; $menu = '\n"; $menu = apply_filters( 'wp_page_menu', $menu, $args ); if ( $args['echo'] ) echo $menu; else return $menu; } function eo_mobile_nav_fallback() { eo_mobile_page_menu( array( 'show_home' => true, 'menu_class' => 'top-nav-mobile tnav_m_fback form-inline', // adding custom nav class 'select_class' => 'eo-mobile-select-nav form-control', // adding custom nav class // 'include' => 9999, // 'show_home' => true, 'exclude' => '', 'echo' => true, 'link_before' => '', // before each link 'link_after' => '' // after each link ) ); } } function eo_page_navi() { global $wp_query; $bignum = 999999999; if ( $wp_query->max_num_pages <= 1 ) return; echo ''; } function eo_snippet( $str, $wcnt = 2, $excl ='' ) { (isset($excl) ) ? $qta = array("'",",","’",$excl) : $qta = array("'",",","’") ; $str = str_replace($qta,"",$str); return implode( '', array_slice( preg_split( '/([\s,\.;\?\!]+)/', $str, $wcnt*2+1, PREG_SPLIT_DELIM_CAPTURE ), 0, $wcnt*2-1 ) ); } function eo_get_gen_clss($id = null) { // Return requested / all generated class if( get_option('eo_gen_opt_cl') ) $gen_opt_clss = get_option('eo_gen_opt_cl'); return (isset($id)) ? $gen_opt_clss[$id] : $gen_opt_clss; } function eo_alert($msg,$typ = 'Note', $cpb = 'edit_theme_options') { if ( current_user_can( $cpb ) ) { $cpb_txt = ucwords(str_replace("_"," ",$cpb)); if(isset($typ)) $type = $typ; $themsg = ucwords($type.' : '.$msg); echo '