function wps_check_mobile() { global $wps_user_agents; if (!is_admin()) { if (wps_is_in_preview_mode()) { add_filter('show_admin_bar', '__return_false'); // don't show admin bar when in preview mode $this->wps_show_mobile = true; } elseif (isset($_COOKIE['wpsmart_view_full_site']) && $_COOKIE['wpsmart_view_full_site'] == 1) { $this->wps_show_mobile = false; add_action('wp_footer', array(&$this, 'wps_view_mobile_site')); } else { $server_user_agent = strtolower($_SERVER['HTTP_USER_AGENT']); foreach ($wps_user_agents as $user_agent) { if (preg_match("/{$user_agent}/", $server_user_agent)) { $this->wps_show_mobile = true; break; } else { $this->wps_show_mobile = false; } } } } }
/** * Draw the header's banner containing logo as well as search and menu drop-downs * */ function wps_banner() { ?> <!-- header --> <header id="masthead" class="site-header" data-role="header" data-position="fixed"> <div id="view-search" class="view-search <?php echo !wps_get_option('enable_search') ? "hidden" : null; ?> "><a href="#"><i class="icon-search"></i></a></div> <div id="view-menu" class="view-menu <?php echo !wps_get_option('enable_menu') ? "hidden" : null; ?> "><a href="#"><i class="icon-reorder"></i></a></div> <h1 class="site-title"> <a href="<?php bloginfo('url'); ?> " target="_self" rel="home"> <?php if (wps_get_option('site_logo') == '') { ?> <?php echo wps_get_option('site_title'); ?> <?php } else { ?> <img src="<?php echo wps_get_option('site_logo'); ?> "/> <?php } ?> </a> </h1> </header> <!-- Advertising code --> <?php if (wps_get_option('advertising_type') == 'google_adsense') { wps_google_adsense_script(wps_get_option('adsense_client_id')); ?> <?php } elseif (wps_get_option('advertising_type') == 'custom_advertising') { echo wps_html_unclean(wps_get_option('custom_advertising_code')); ?> <?php } ?> <!-- menu bar --> <div class="menu-bar header-drop-down"> <ul> <?php foreach (wps_get_menu_links() as $links) { ?> <li><a href="<?php echo $links['url']; ?> " target="_self"><?php echo $links['title']; ?> </a></li> <?php } ?> </ul> </div> <!-- search form drop-down --> <div class="search-bar header-drop-down"> <div class="search-head"> <form action="<?php echo home_url('/'); ?> " method="get" id="search-form" autocomplete="off" data-ajax="false"> <?php if (wps_is_in_preview_mode()) { ?> <input type="hidden" name="wps_preview" value="1"/> <?php } ?> <div class="search-input-wrap input-wrap"> <label id="search-input-label">Search by article title</label> <input id="s" name="s" type="search" value="" /> </div> </form> </div> </div> <?php }