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 = '
' . $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($maxpn=NULL) { global $wp_query; (isset($maxpn)) ? $maxnum = $maxpn : $maxnum = $wp_query->max_num_pages; $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 '
'.$themsg.' Dont worry, this is only shown to those who can '.$cpb_txt.'
'; } } function eo_xcrpt( $l=NULL,$e=true,$ap=NULL ) { $excerpt = get_the_excerpt(); (isset($l)) ? $limit = $l : $limit = 20; if (str_word_count($excerpt, 0) > $limit) { $words = str_word_count($excerpt, 2); $pos = array_keys($words); $excerpt = substr($excerpt, 0, $pos[$limit]) . '...'; } if($e) { echo $excerpt; } else { return $excerpt; } } function eo_trim( $str,$l=NULL, $e=true,$ap=NULL ) { (isset($l)) ? $l = $l : $l = 20; if(isset($ap)) { $apl = mb_strlen($ap); $min = $apl + $l; } else { $min = 23; $ap = '...'; } $str = (mb_strlen($str) > $min) ? mb_substr($str,0,$l).$ap : $str; if($e) { echo $str; } else { return $str; } } if ( ! function_exists( 'eo_infinite_scroll_js' ) ) { function eo_infinite_scroll_js() { global $eo_options; if ( ( $eo_options['inf_scroll'] == '1' ) && ( is_home() || is_archive() ) ) { ?> false, 'publicly_queryable' => true ) ); $post_types_neu = array(); foreach($post_types as $post_type) { $post_types_neu[$post_type] = ucfirst($post_type); } $post_types_neu["post"] = "Posts"; return $post_types_neu; } function eo_get_dashboxes() { global $wp_version; $dashboxes = array( "dashboard_right_now" => "Dash. Right Now", "dashboard_recent_comments" => "Recent Comments", "dashboard_incoming_links" => "Incoming Links", "dashboard_plugins" => "Plugins Widget", "dashboard_quick_press" => "Quick Press", "dashboard_recent_drafts" => "Recent Drafts", "dashboard_primary" => "Dashboard Primary", "dashboard_secondary" => "Dashboard Secondary", "eo_theme_dash" => "eoTheme News", ); if ( $wp_version >= 3.8 ) { $dashboxes["dashboard_activity"] = "Dashboard Activity"; } return $dashboxes; } function eovd($dw) { echo "
";
	var_dump($dw);
	echo "
"; } function eoperc($num_amount, $num_total,$fl=false,$e=false) { $count1 = $num_amount / $num_total; ($fl) ? $count2 = floor($count1 * 100) : $count2 = $count1 * 100; $count = number_format($count2, 0); return $count; } function eo_get_cols($ctg,$add_cl='',$e=true) { global $eo_options; //$col_cls = array("xs","sm","md","lg"); if($ctg == 'main') { $tarr = array("layout_xs_main"=>"12","layout_sm_main"=>"8","layout_md_main"=>"8","layout_lg_main"=>"9"); } elseif($ctg == 'side') { $tarr = array("layout_xs_side"=>"12","layout_sm_side"=>"8","layout_md_side"=>"8","layout_lg_side"=>"9"); } $colz = ''; foreach ($tarr as $k => $defv ) { if($ctg == "main") { $sz = str_replace(array('layout_', '_main'), '', $k); } else if($ctg == "side") { $sz = str_replace(array('layout_', '_side'), '', $k); } ($sz == "lg") ? $sep = '' : $sep = ' '; if( array_key_exists($k,$eo_options) ) { if( $eo_options[$k] == "0" ) { $colz = $colz.'hidden-'.$sz.$sep; } elseif($eo_options[$k] == "-1" ) { $colz = $colz; } elseif($eo_options[$k] != "0" ) { $colz = $colz.'col-'.$sz.'-'.$eo_options[$k].$sep; } } else { $colz = $colz.'col-'.$sz.'-'.$defv.$sep; } } if(!empty($add_cl) ) $colz = $colz.$add_cl; if($e){ echo $colz; } else { return $colz; } } ?>