<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title><?php the_title(); ?> </title>
		<?php wp_head(); ?>
    <!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
    <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
    <!--[if lt IE 9]>
      <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
      <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
    <![endif]-->
  </head>

<body>

<?php
$taxonomy = get_queried_object();
$current_slug = urldecode($taxonomy->slug);

if($current_slug == ''):
  $terms = wp_get_post_terms(get_the_ID(),'regions');
  foreach($terms as $term):
    //$final_term_name = $term->name;
    $current_slug = $term->slug;
  endforeach;
endif;
if($current_slug == ''):
  $current_slug = 'اسلام-آباد';
endif;
if(is_page('guzishta')):
  if(isset($_GET['region'])):
    $current_slug = $_GET['region'];
  else:
    $current_slug = 'اسلام-آباد';
endif;
endif;
?>
  <div class="container">
    <div class="box_wrapper">
      <!-- ==================start header=============== -->
      <header id="header">
        <!-- start header bottom area -->
        <div class="header_bottom">
          <div class="logo_area">
          <!-- for your image logo -->
          <!-- <a class="logo" href="index.html">
           <img src="img/logo.jpg" alt="logo">
          </a> -->

          <!-- for your text logo -->
            <a class="logo" href="<?php echo esc_url(home_url('/')); ?>">
            	<img src="<?php echo get_template_directory_uri(); ?>/img/logo.png" alt="logo"/>
            </a>

          </div>
          <div class="top_addarea">
            <select class="form-control" id="regiondd">

              <?php $terms = get_terms( array(
                      'taxonomy' => 'regions',
                      'hide_empty' => false,
                      ) );
              foreach($terms as $term):
              ?>

            	  <option value="<?php echo get_term_link($term); ?>" <?php if($current_slug == $term->slug):?> selected <?php endif; ?>><?php echo $term->name; ?></option>
              <?php endforeach;?>

            </select>
          </div>
        </div>
        <!-- start header top area -->

        <!-- start header top area -->
        <div class="header_top">
            <!-- Static navbar -->
          <nav class="navbar navbar-default" role="navigation">
            <div class="container-fluid">
              <div class="navbar-header">
                <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar">
                  <span class="sr-only">Toggle navigation</span>
                  <span class="icon-bar"></span>
                  <span class="icon-bar"></span>
                  <span class="icon-bar"></span>
                </button>
              </div>
              <div id="navbar" class="navbar-collapse collapse">
                <ul class="nav navbar-nav custom_nav">
                  <li class=""><a href="<?php echo esc_url(home_url('/')); ?>">ہوم</a></li>
                  <li><a href="/ep/guzishta/?region=<?php echo $current_slug; ?>">گزشتہ شمارے</a></li>
                  <li><a href="/ep/magazine/">میگزین</a></li>
                  <li><a href="/ep/contact">رابطے کے لئے</a></li>
<li><a href="/ep/guzishta-20152016/">2015/2016 گزشتہ شمارے</a></li>
                </ul>
              </div><!--/.nav-collapse -->
            </div><!--/.container-fluid -->
          </nav>

        </div>
        <!-- End header top area -->

      </header>
      <!-- ==================End header=============== -->
