<?php
	if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
	wp_reset_query();


		

	//sidebars
	$sidebar = get_post_meta ( ot_page_id(), "_".THEME_NAME."_sidebar_select", true ); 
	$sidebarPosition = get_option ( THEME_NAME."_sidebar_position" ); 
	$sidebarPositionCustom = get_post_meta ( ot_page_id(), "_".THEME_NAME."_sidebar_position", true ); 


	if(is_category()) {
		$catID = get_cat_id( single_cat_title("",false) );
		//sidebars
		$sidebar = ot_get_option ( $catID, "sidebar_select", false ); 
		$sidebarPositionCustom = ot_get_option ( $catID, "sidebar_position", false ); 
	} elseif(is_tax()){
		$sidebar = ot_get_option ( get_queried_object()->term_id, "sidebar_select", false );
		$sidebarPositionCustom = ot_get_option ( get_queried_object()->term_id, "sidebar_position", false );
	}

	if(is_search()) {
		$sidebarPosition = "right";
	}
	
	$topIcons = get_option(THEME_NAME."_top_icons");
	$twitter = get_option(THEME_NAME."_twitter");
	$tumblrk = get_option(THEME_NAME."_tumblr");
	$pinterest = get_option(THEME_NAME."_pinterest");
	$linkedin = get_option(THEME_NAME."_linkedin");
?>


			<!-- BEGIN .content -->
			<div class="content">
				
				<!-- BEGIN .wrapper -->
				<div class="wrapper">
				    <?php if($topIcons=="on" || $customHTML!="") { ?>
						<!-- BEGIN .full-block -->
						<div class="full-block with-border-bottom">
							<?php if($topIcons=="on") { ?>
								<div class="right social-content">
									<?php if($rss) { ?><a href="<?php echo $rss;?>" target="_blank" class="soc-rss-icon"><i class="fa fa-rss"></i></a><?php } ?>
									<?php if($pinterest) { ?><a href="<?php echo $pinterest;?>" target="_blank" class="soc-pinterest-icon"><i class="fa fa-pinterest"></i></a><?php } ?>
									<?php if($linkedin) { ?><a href="<?php echo $linkedin;?>" target="_blank" class="soc-linkedin-icon"><i class="fa fa-linkedin"></i></a><?php } ?>
									<?php if($tumblrk) { ?><a href="<?php echo $tumblrk;?>" target="_blank" class="soc-facebook-icon"><i class="fa fa-tumblr"></i></a><?php } ?>
									<?php if($twitter) { ?><a href="<?php echo $twitter;?>" target="_blank" class="soc-twitter-icon"><i class="fa fa-twitter"></i></a><?php } ?>
								</div>
							<?php } ?>
							<?php if($customHTML) { ?>
								<div class="advert-links">
									<?php echo stripcslashes($customHTML);?>
								</div>
							<?php } ?>
							<div class="clear-float"></div>
							<!-- END .full-block -->
						</div>
					<?php } ?>
					<?php 
						if(is_page_template( "template-homepage.php" )) {
							get_template_part(THEME_SLIDERS."breaking-news"); 
						}
					?>	
					<?php 
						if( $sidebarPosition == "left" || ( $sidebarPosition == "custom" && $sidebarPositionCustom == "left") ) { 
							get_template_part(THEME_INCLUDES."sidebar");
						}
					?>

					<!-- BEGIN .main-content-left -->
					<div class="main-content-<?php if($sidebar!='off') { echo "left"; } else { echo "full" ;} ?>">
						<?php get_template_part(THEME_INCLUDES.'social'); ?>
						<?php wp_reset_query();  ?>