<?php get_header(); ?>

<article>
	<div class="page archive">
		<?php if(have_posts()) :?>
		<?php while(have_posts()):the_post();?>
			<div class="posts">
				<a href="<?php the_permalink();?>"><?php if ( has_post_thumbnail()) the_post_thumbnail('medium'); ?></a>
				<h2 class="title">
					<a href="<?php the_permalink();?>"><?php if (strlen($post->post_title) > 90) { echo mb_substr(the_title($before = '', $after = '', FALSE), 0, 60) . '...'; } else { the_title(); } ?></a>
				</h2>
				<div class="excerpt">
					<?php the_excerpt();?>
				</div>
				<a class="readmore" href="<?php the_permalink();?>">ادامه مطلب</a>
				<ul class="meta">
					<li><i class="icon icon-eye"></i><?php $Views = get_post_meta($post->ID, 'views',true); if (!empty($Views)) { echo ztjalali_persian_num( $Views ); ?> مشاهده <?php } else { ?>-<?php } ?><i class="view"></i></li>
					<li><i class="icon icon-menu"></i><?php the_excluded_category(array(47,48)); ?></li>
					<li><i class="icon icon-comments"></i><?php comments_number('0', '1 نظر', '% نظر'); ?></li>
					<li><i class="icon icon-calendar2"></i><?php the_time('j F Y');?></li>
				</ul>
			</div>
		<?php endwhile; ?>
		<?php endif; ?>

		<?php wp_pagenavi(); ?>
	</div>
</article>

<aside class="rightside">
	<?php dynamic_sidebar( 'سایدبار راست' ); ?>
</aside>

<aside class="leftside">
	<?php dynamic_sidebar( 'سایدبار چپ' ); ?>
</aside>

<?php get_footer(); ?>