<?php get_header(); ?>
<div id="awrap">
<div id="content">
<div class="clear"></div>
<?php get_sidebar(); ?>
<div class="solbar">
<?php if (have_posts()) : ?><?php while (have_posts()) : the_post(); ?>
<div class="d-baslik"><b><span>کد خبر: <?php echo get_the_ID(); ?> </span></b><p>تاریخ انتشار: <?php the_time(' Y/m/d - G:i'); ?></p></div>
<div class="neredeyim">
<?php if(function_exists('wp_print')) { print_link(); } ?>
<a href="#" class="save_file left" download="">ذخیره فایل</a>
<?php echo direct_email('ارسال به دوستان ') ?>
<a href="#" id="increase-font" class="big_font left"></a>
<a href="#" id="decrease-font" class="small_font left"></a>
</div>
<div class="icerik">
<p class="d-baslik-p"> <?php echo esc_attr(get_post_meta(get_the_ID() , 'irp_post_rutitr' , true)); ?></p>
<h1 class="d-baslik-h1"><?php the_title(); ?></h1>
<div class="summary">
<p><?php the_excerpt(); ?></p>
</div>
<div class="content_p">
<center>
<?php if (has_post_thumbnail()) { the_post_thumbnail('news_thumbs', array('alt' => get_the_title() ));} else { ?>
<img src="<?php bloginfo('template_directory'); ?>/images/no-thumb.png" title="<?php the_title(); ?>" alt="<?php the_title(); ?>" />
<?php } ?><br/>
</center>
<?php the_content(''); ?>
</div>
<div class="clr"></div><div class="etiket"><?php the_tags('برچسب ها: ',' ',' , ',' '); ?></div>
</div><!-- icerik / End -->
<?php endwhile; ?>
<?php endif; ?>
<div class="clr"></div>
<div class="d-baslik"><b><span>مطالب مرتبط</span></b><p></p></div>
<?php
$tags = wp_get_post_tags($post->ID);
if ($tags) {
$first_tag = $tags[0]->term_id;
$args=array(
'tag__in' => array($first_tag),
'post__not_in' => array($post->ID),
'showposts'=>5,
'caller_get_posts'=>1
);
$rel_posts = new WP_Query($args);
if( $rel_posts->have_posts() ) {
while ($rel_posts->have_posts()) : $rel_posts->the_post(); ?>
<div class="rel_posts">
<div class="rel_thumb"><a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>"><?php the_post_thumbnail(array(85,85)); ?></a></div>
<div class="rel_link"><a href="<?php the_permalink() ?>" rel="bookmark" title="<?php the_title(); ?>"><?php the_title(); ?></a></div>
</div>
<?php
endwhile;
}
}
?>
<div class="clearer"></div>
<?php comments_template(); ?>
</div><!-- solbar / End -->
<div class="ads-bars">
<?php if ( !dynamic_sidebar('ads_sidebar') ) : ?>
<?php endif;?>
</div><!-- Ads / End -->
</div><!-- content / End -->
</div><!-- awarp / End -->
<?php get_footer(); ?>