File: /home/heewonvps_17/drug-injury-lawyer.com/wp-content/themes/master/search.php
<?php
/**
* The template for displaying Search Results pages.
*
* @package WordPress
* @subpackage Twenty_Ten
* @since Twenty Ten 1.0
*/
include 'Mobile_Detect.php';
global $is_mobile;
session_start();
$type = null;
$uri = null;
$detect = new Mobile_Detect();
if (isset($_GET['view'])) {
$type = $_GET['view'];
set_view_type($type);
}
if (isset($_SESSION['view_type'])) {
if ($_SESSION['view_type'] == 'mobile') {
$_SESSION['which_page'] = 'mobile';
} else if ($_SESSION['view_type'] == 'classic') {
$_SESSION['which_page'] = '';
}
} else if (MobileDTS::is('android')) {
// User with a mobile device running Android OS
$_SESSION['which_page'] = 'mobile';
} else if ($detect->isTablet()) {
$_SESSION['which_page'] = '';
} else if (MobileDTS::is('ios')) {
// User with a mobile device running iOS
$_SESSION['which_page'] = 'mobile';
} else if (MobileDTS::is('mobile')) {
// User with a mobile device (any, even 10 years old mobile phones)
$_SESSION['which_page'] = 'mobile';
} else {
// User with a desktop device
$_SESSION['which_page'] = '';
}
get_header($_SESSION['which_page']); ?>
<div id="container">
<div id="content">
<?php if ( have_posts() ) : ?>
<p class="page-title"><?php printf( __( 'Search Results for: %s', 'twentyten' ), '<span>"' . get_search_query() . '"</span>' ); ?></p>
<?php
/* Run the loop for the search to output the results.
* If you want to overload this in a child theme then include a file
* called loop-search.php and that will be used instead.
*/
get_template_part( 'loop', 'search' );
?>
<?php else : ?>
<div id="post-0" class="post no-results not-found">
<p class="page-title">Not Found</p>
<h1 class="entry-title"><?php _e( 'Sorry', 'twentyten' ); ?></h1>
<div class="entry-content">
<p><?php _e( 'Nothing matched your search criteria. Please try again with some different keywords.', 'twentyten' ); ?></p>
<?php get_search_form(); ?>
</div><!-- .entry-content -->
</div><!-- #post-0 -->
<?php endif; ?>
</div><!-- #content -->
<?php if ($_SESSION['which_page'] != 'mobile') : ?>
<div id="sidebar">
<?php get_sidebar(); ?>
</div><!-- #sidebar -->
<div class="clear"> </div>
<?php endif; ?>
<?php get_footer($_SESSION['which_page']); ?>