<?php global $qaleb;?>
<div id="ap_root">
<div class="dark">
<?php if($qaleb['hadis-ac']=='1'){?>
<div id="ap_breaking" class="breaking clearfix">
<div class="container">
<div class="t"><h3><?php echo $qaleb['hadis-title'];?></h3></div>
<div class="breaking-frame">
<h3><a href="<?php echo $qaleb['hadis-link'];?>"><?php echo $qaleb['hadis-html'];?></a></h3>
</div>
<span class="close_btn"><i class="fa fa-1x fa-times"></i></span>
</div>
</div>
<?php } ?>
<div class="ap_header">
<div class="container-max inn">
<div class="header_right">
<div class="ap_logo">
      <a href="<?php bloginfo('url'); ?>">
    <?php if($qaleb['logo-or-title'] == '1'){?>
      <img src="<?php echo $qaleb['siteicon_uploader']['url']; ?>" alt="<?php echo bloginfo("name");?>">
     <?php }else{ ?>
     <h1><?php echo bloginfo("name");?></h1>
	 <span><?php bloginfo('description'); ?></span>
     <?php } ?>
      </a>
</div>
</div>
<div class="ap-nav">
<div class="ap_time">
<?php if($qaleb['fa-clock']=='1'){?>
<script type="text/javascript">
function startTime()
{
var today=new Date();
var h=today.getHours();
var m=today.getMinutes();
var s=today.getSeconds();
// add a zero in front of numbers<10
m=checkTime(m);
s=checkTime(s);
document.getElementById('clock').innerHTML=h+":"+m+":"+s;
t=setTimeout('startTime()',500);
}
function checkTime(i)
{
if (i<10)
  {
  i="0" + i;
  }
return i;
}
</script>
<b><span id="clock"> <script type="text/javascript">startTime()</script></span></b><?php } ?>
<?php if($qaleb['jalali']=='1'){?>
<?php if(function_exists('parsidate')) { ?>
<b><b>تاریخ :</b> <?php echo parsidate('l, j F , Y'); ?></b>
<?php } else { ?>
<b> افزونه پارسی دیت را نصب کنید </b>
<?php } ?>
<?php } ?>
<?php if($qaleb['milad']=='1'){?><b> <?php echo date ('l, j F , Y') ; ?></b><?php } ?>
</div>
<div class="menu"><?php wp_nav_menu( array( 'theme_location' => 'primary' )); ?></div>
</div>
<div class="ap-search">
<div class="menu-bottom"><span class="fa fa-bars navbar-c-toggle menu-show" style="float:right" ></span></div>
<div class="ap-am">
<?php if($qaleb['all-news']=='1'){?><b><?php echo $qaleb['all-news-title'];?><span> <?php $num_posts = wp_count_posts( 'post' ); $num_posts = $num_posts->publish; echo '' . $num_posts . ''; ?></span></b><?php } ?>
<?php if($qaleb['corent-news']=='1'){?><b><?php echo $qaleb['corent-news-title'];?><span> <?php echo wpp_post_count_by_date(); ?></span></b><?php } ?>
</div>                         							  

<?php if($qaleb['top-menu-ac']=='1'){?><button onclick="myFunction()" class="dropbtn"></button><?php } ?>
<?php if($qaleb['searchform-ac']=='1'){?><i id="search-btn" class="fa fa-search"></i><?php } ?>

<?php if($qaleb['night']=='1'){?>
<div class="custom-control custom-switch">
<input type="checkbox" class="custom-control-input" id="darkSwitch">
<label class="custom-control-label" for="darkSwitch"></label>
</div>
<script>!function(){var t,e=document.getElementById("darkSwitch");if(e){t=null!==localStorage.getItem("darkSwitch")&&"dark"===localStorage.getItem("darkSwitch"),(e.checked=t)?document.body.setAttribute("data-theme","dark"):document.body.removeAttribute("data-theme"),e.addEventListener("change",function(t){e.checked?(document.body.setAttribute("data-theme","dark"),localStorage.setItem("darkSwitch","dark")):(document.body.removeAttribute("data-theme"),localStorage.removeItem("darkSwitch"))})}}();</script>
<?php } ?>  
<?php if($qaleb['shopform']=='1'){?>
<?php if(function_exists('WC')) { ?><a href="<?php echo $qaleb['cart-site'];?>" class="cartt"><span><?php echo WC()->cart->get_cart_contents_count(); ?></span></a><?php } else { ?> <a class="cartt"></a><?php } ?>
<?php } ?> 
</div>
</div>
<?php if($qaleb['top-menu-ac']=='1'){?>
 <div class="dropdown">
  <div id="myDropdown" class="dropdown-content">
  <ul>
  <div class="container">
      <div class="vertical-menu">
       <?php wp_nav_menu( array( 'theme_location' => 'top-nav' )); ?>
      </div>
  </div></ul>
  </div>
</div> 
<?php } ?>
<?php get_template_part('inc/breaking'); ?>
</div>
</div>
<div class="menu-hidden menu-show" id="menu-risponsive">
<?php wp_nav_menu( array( 'theme_location' => 'sid-nav' )); ?>
</div>
<?php get_template_part('inc/icon-left'); ?>
<div class="nav-lin"></div>