<?php 
get_header();

global $wpdb, $post, $opt_themes;  
$search_results	= $opt_themes['exthemes_Searchresults'];
$sidebar_on		= $opt_themes['sidebar_activated_'];
$text_not_found	= $opt_themes['exthemes_File_not_founds']; 
$search_term	= substr($_SERVER['REQUEST_URI'], 1);
$search_term	= urldecode(stripslashes($search_term));
$search_term	= rtrim($search_term, "/");
$find			= array("'.html'", "'.+/'", "'[-/_]'");
$replace		= " ";
$search_term	= trim(preg_replace($find, $replace, $search_term));
$search_term	= str_replace("%20", $replace, $search_term);
$search_term	= preg_replace('!\s+!', ' ', $search_term);
?> 

<div id="content" class="site-content">

	<?php switch ($opt_themes['themes_styles']) { case 'liteapks': ?>
	<div class="py-2">
	<div class="container">
	<?php break; } ?>
	<ul id="breadcrumb" class="
	<?php 
	switch($opt_themes['themes_styles']){
	case 'moddroid':
	?>
	pt-1 pb-3 breadcrumb
	<?php
	break; 	
	case 'modyolo':
	?>
	pt-1 pb-3 breadcrumb
	<?php
	break; 	
	case 'reborn':
	?>
	pt-1 pb-3 breadcrumb
	<?php
	break; 	
	case 'liteapks':
	?>
	 breadcrumb
	<?php	
	break; 
	default:
	?>
	pt-1 pb-3 breadcrumb
	<?php
	break; 
	}
	?>"  itemscope='itemscope' itemtype='https://schema.org/BreadcrumbList' <?php if ($opt_themes['ex_themes_breadcrumbs_activate_']) { ?>style="display:none"<?php } ?>>
	<li class="breadcrumb-item home" itemprop="itemListElement" itemscope="itemscope" itemtype="http://schema.org/ListItem">
	<a href="<?php echo get_bloginfo("home"); ?>" title="<?php _e($opt_themes['text_homes'], TEXT_DOMAIN); ?>"> <?php _e($opt_themes['text_homes'], TEXT_DOMAIN); ?>
	<meta itemprop='item' content='<?php echo get_bloginfo("home"); ?>' />
	<meta itemprop='name' content='<?php _e($opt_themes['text_homes'], TEXT_DOMAIN); ?>' />
	<meta itemprop='position' content='1' />
	</a>
	</li>
	<li class="breadcrumb-item active">
	<?php echo get_search_query(); ?>
	</li>
	</ul>
	<?php switch ($opt_themes['themes_styles']) { case 'liteapks': ?>
	</div>
	</div>
	<?php break; } ?>

	<div class="container<?php switch ($opt_themes['themes_styles']) { case 'liteapks': ?> py-4<?php break; } ?> ">
	 
	
	
	
	<?php 
	switch($opt_themes['themes_styles']){
	case 'moddroid':
	?>
	<div class="row">
	<?php 
	do_action('main_home');
	do_action('section_search');
	?>
	<div class="m-3"><?php ex_themes_banner_header_ads_(); ?></div>	
	<div class="row">
	<?php
	break; 	
	case 'modyolo':
	?>
	<div class="row">
	<?php 
	do_action('main_home');
	do_action('section_search');
	?>
	<div class="m-3"><?php ex_themes_banner_header_ads_(); ?></div>	
	<div class="row">
	<?php
	break; 	
	case 'reborn':
	?>
	<div class="row">
	<?php 
	do_action('main_home');
	do_action('section_search');
	?>
	<div class="m-3"><?php ex_themes_banner_header_ads_(); ?></div>	
	<div class="row">
	<?php
	break; 	
	case 'liteapks':
	?>
	<main id="primary" class="content-area">
	<h2 class="font-weight-bold mb-4"><?php _e($opt_themes['exthemes_Searchresults'], TEXT_DOMAIN); ?> <?php echo get_search_query(); ?></h2>
	<div class="row">
	<?php	
	break; 
	default:
	?>
	<div class="row">
	<?php 
	do_action('main_home');
	do_action('section_search');
	?>
	<div class="m-3"><?php ex_themes_banner_header_ads_(); ?></div>	
	<div class="row">
	<?php
	break; 
	}
	?>
	 

	<?php $postcounter = 1; if(have_posts()) : ?>
	<?php switch (!$opt_themes['themes_styles']) { case 'liteapks': ?><div class="row"><?php break; } ?> 
	<?php 
	while(have_posts()) : 
	$postcounter = $postcounter + 1; 
	the_post(); 
	$do_not_duplicate = $post->ID; 
	$the_post_ids = get_the_ID();  

	switch($opt_themes['themes_styles']){
	case 'moddroid':
	get_template_part('loop/item.mdr'); 
	break; 
	
	case 'modyolo':
	get_template_part('loop/item.mdy'); 
	break; 
	
	case 'reborn':
	get_template_part('loop/item.reborn');
	break; 
	
	case 'liteapks':
	get_template_part('loop/item.liteapks');
	break; 
	
	default:
	get_template_part('loop/item.mdr'); 
	break;
	}
	endwhile;
	?>
	

	<?php endif; ?>
	
	<?php if(!have_posts()) { ?>
	<div class="container">
	<div class="alert alert-danger mb-4"><?php _e($opt_themes['exthemes_File_not_founds'], TEXT_DOMAIN); ?></div>
	</div>
	<?php } ?> 
	<?php 
	switch($opt_themes['themes_styles']){
	case 'moddroid':
	?>
	<?php
	sp_close_section();
	get_template_part('include/nav');
	sp_close_main();
	?>

	<!--sidebar-->
	<?php do_action('sidebar'); ?>
	<!--sidebar-->
	<?php
	break; 	
	case 'modyolo':
	?>
	<?php
	sp_close_section();
	get_template_part('include/nav');
	sp_close_main();
	?>

	<!--sidebar-->
	<?php do_action('sidebar'); ?>
	<!--sidebar-->
	<?php
	break; 	
	case 'reborn':
	?>
	<?php
	sp_close_section();
	get_template_part('include/nav');
	sp_close_main();
	?>

	<!--sidebar-->
	<?php do_action('sidebar'); ?>
	<!--sidebar-->
	<?php
	break; 	
	case 'liteapks':
	?>
	
	<?php	
	break; 
	default:
	?>
	<?php
	sp_close_section();
	get_template_part('include/nav');
	sp_close_main();
	?>

	<!--sidebar-->
	<?php do_action('sidebar'); ?>
	<!--sidebar-->
	<?php
	break; 
	}
	?>
	</div>
	<?php switch ($opt_themes['themes_styles']) { case 'liteapks': ?>
	<?php get_template_part('include/nav'); ?>
	<?php break; } ?>
	</div>
</div> 

<?php
get_footer(); 