<?php get_header(); ?>
<?php global $qaleb;?>
<div id="President">
<div class="container">

<section id="entry-content">
<div class="head-single">
<div class="headr">
<?php if($qaleb['headr']=='1'){?><a href="<?php bloginfo('url'); ?>"> صفحه نخست / </a>  <?php the_category(' / ' ); ?><?php } ?>
</div>
<div class="headl">
<?php if($qaleb['print']=='1'){?><span><a href="#" class="tooltip tooltip-top" data-iro="پرینت از مطلب" style="line-height: 28px;" onclick='window.open("<?php the_permalink();?>?print=1", "printwin","left=200,top=200,width=820,height=550,toolbar=1,resizable=0,status=0,scrollbars=1");'><i class="fa fa-print"></i></a></span><?php } ?>
<?php if($qaleb['single-font-ac']=='1'){?>
<span>
<li class="font-size-control plus tooltip tooltip-top" data-iro="بزرگنمایی" data-action="increase"><a class="fa fa-plus-square" aria-hidden="true"></a></li>
<li><i class="fa fa-text-height" aria-hidden="true"></i></li>
<li class="font-size-control tooltip tooltip-top" data-iro="کوچکنمایی" data-action="decrease"><a class="fa fa-minus-square" aria-hidden="true"></a></li>
</span>
<?php } ?>
</div>
</div>

<div class="bot-single">
<div class="botr">
<?php if($qaleb['rotitr']=='1'){?>
<?php if(get_post_meta( get_the_ID(), 'meta-text-1', true )!=null){ ?><div class="rotii"><?php echo get_post_meta( get_the_ID(), 'meta-text-1', true ); ?></div><?php } ?>
<?php } ?>
<h1> <a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>"><?php the_title(); ?></a></h1>
<?php if($qaleb['lide']=='1'){?><div class="botd"><?php if(get_meta('lead') != false) : echo get_meta('lead'); else : the_excerpt(); endif; ?></div><?php } ?>
</div>

<div class="botl">
<?php if(has_post_thumbnail()){?>
<a href="<?php the_permalink(); ?>"><img src="<?php the_post_thumbnail_url(''); ?>"></a>
<?php }else{ ?>
<img src="<?php bloginfo("template_url"); ?>/img/none.png">
<?php } ?>
</div>
</div>

<div class="player-bottom">
<?php if($qaleb['single-social-ac']=='1'){?><div data-toggle="modal" data-target="#left_modal_xs" class="btn-download"><i class="fa fa-share-alt" aria-hidden="true"></i> اشتراک گذاری</div><?php } ?>
<?php if($qaleb['singl-date-ac']=='1'){?><div class="video-list"><i class="fa fa-calendar"></i> <?php the_time(' d F Y ');  ?></div><?php } ?>
<?php if($qaleb['singl-view-ac']=='1'){?><div class="video-list"><i class="fa fa-pie-chart" aria-hidden="true"></i> <?php echo getPostViews(get_the_ID()); ?></div><?php } ?>
<?php if($qaleb['singl-user-ac']=='1'){?><div class="video-list"><i class="fa fa-user" aria-hidden="true"></i> <?php the_author_posts_link(); ?></div><?php } ?>

<?php if(get_post_meta( get_the_ID(), 'meta-text-3', true )!=null){ ?><div class="video-list"><i class="fa fa-pencil" aria-hidden="true"></i><span> نویسنده : </span><?php echo get_post_meta( get_the_ID(), 'meta-text-3', true ); ?></div><?php } ?>
<?php if(get_post_meta( get_the_ID(), 'meta-text-4', true )!=null){ ?><div class="video-list"><i class="fa fa-question-circle-o" aria-hidden="true"></i><span> منبع : </span><?php echo get_post_meta( get_the_ID(), 'meta-text-4', true ); ?></div><?php } ?>
<?php if($qaleb['singl-cod-ac']=='1'){?><div class="video-list"><i class="fa fa-file-text-o"></i> کد مطلب : <?php the_ID();?></div><?php } ?>
</div>
<div class="contentt">
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
<?php setPostViews(get_the_ID()); ?>
<?php the_content(); ?>
<?php endwhile; else : endif; ?>
</div>

<?php if($qaleb['singl-tags-ac']=='1'){?>
<div class="tag-items">
<i class="fa fa-tags"></i> <?php the_tags('',' '); ?><?php if(has_tag()){ echo ' '; }else { echo '<p style="font:12px Sahel-Light">این مطلب بدون برچسب می باشد.</p>';}?>
</div>
<?php } ?>

<?php if($qaleb['relate-default']=='1'){?>
<?php if($qaleb['norm-or-tage'] == '1'){?>
<?php get_template_part('inc/item/relat-norm'); ?>
<?php }else{ ?>
<?php get_template_part('inc/item/relat-tage'); ?>
<?php } ?>
<?php } ?>
<?php comments_template(); ?>
</section>
<section id="entry-saidbar">
<?php if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar('sidebar-single') ) : ?><?php endif; ?>
</section>
</div>
<div class="lin"></div>
</div>

<?php if($qaleb['single-social-ac']=='1'){?>
<div class="modal modal-left xs fade" id="left_modal_xs" tabindex="-1" role="dialog" aria-labelledby="top_modal">
  <div class="modal-dialog modal-sm modal-dialog-centered" role="document">
    <div class="modal-content h-auto rounded-right">
      <div class="modal-header">
        <h5 class="modal-title">بـه اشـتراک بـگذارید</h5>
        <button type="button" class="close" data-dismiss="modal" aria-label="Close">
          <span aria-hidden="true">&times;</span>
        </button>
      </div>
      <div class="modal-body text-center">
		<a href="http://twitter.com/home?status=<?php the_permalink(); ?>" class="btn-twitter tooltip tooltip-top" data-iro="توییتر"><i class="fa fa-twitter"></i></a>
		<a href="http://www.facebook.com/sharer/sharer.php?u=<?php the_permalink(); ?>" class="btn-facebook tooltip tooltip-top" data-iro="فیسبوک"><i class="fa fa-facebook"></i></a>
		<a href="http://plus.google.com/share?url=<?php the_permalink(); ?>" class="btn-plus tooltip tooltip-top" data-iro="گوگل پلاس"><i class="fa fa-google-plus" aria-hidden="true"></i></a>
		<a href="https://www.linkedin.com/shareArticle?mini=true&amp;url=<?php the_permalink() ?>" class="btn-linkedin tooltip tooltip-top" data-iro="لینکداین"><i class="fa fa-linkedin"></i></a>
		<a href="https://telegram.me/share/url?url=<?php the_permalink(); ?>" class="btn-telegram tooltip tooltip-top" data-iro="تلگرام"><i class="fa fa-send-o"></i></a>
		<a href="https://wa.me/?text=<?php the_permalink(); ?>" class="btn-whatsapp tooltip tooltip-top" data-iro="واتساپ"><i class="fa fa-whatsapp"></i></a>  
      </div>	  
<?php if($qaleb['singl-link-ac']=='1'){?>
    <div class="item-cop">
        <div class="texxt"><?php echo wp_get_shortlink(); ?></div>
        <div class="coop" data-text="کپی" data-text-copied="کپی شد">
            <i class="fa fa-files-o" aria-hidden="true"></i>
            <span>کپی</span>
        </div>
    </div>
<?php } ?>	  	  
    </div>
  </div>
</div>
<?php } ?>
<?php get_footer(); ?>
<?php if($qaleb['singl-link-ac']=='1'){?>
<script>
    $('div').copiq({
        parent: '.item-cop',
        content: '.texxt',
        onSuccess: function($element, source, selection) {
            $('span', $element).text($element.attr("data-text-copied"));
            setTimeout(function() {
                $('span', $element).text($element.attr("data-text"));
            }, 2000);
        }
    });
</script>
<?php } ?>