File: /home/rasad/public_html/wp-content/themes/ofogh/inc/relate.php
<?php global $qaleb;?>
<?php if($qaleb['relate-ac']=='1'){?>
<div class="tttl">
<h3><?php echo $qaleb['relate-default-title']; ?></h3>
</div>
<section class="related_posts">
<?php if($qaleb['norm-or-tage'] == '1'){?>
<?php $related = get_posts( array( 'category__in' => wp_get_post_categories($post->ID), 'numberposts' => $qaleb['relate-count'], 'post__not_in' => array($post->ID) ) ); if( $related ) foreach( $related as $post ) { setup_postdata($post); ?>
<div class="item">
<?php if($qaleb['relate-thumb'] == '1'){?>
<div class="thumb">
<?php if(has_post_thumbnail()){?>
<a href="<?php the_permalink(); ?>"><img src="<?php the_post_thumbnail_url('medium'); ?>" alt="<?php the_title(); ?>"></a>
<?php }else{ ?>
<img src="<?php bloginfo("template_url"); ?>/img/none.png">
<?php } ?>
</div>
<?php } ?>
<div class="det" style="<?php if($qaleb['relate-thumb'] == '1'){?><?php }else{ ?>width:100%;<?php } ?>">
<?php if($qaleb['relate-rott']=='1'){?>
<?php if(get_post_meta( get_the_ID(), 'meta-text-1', true )!=null){ ?><div class="rott"><?php echo get_post_meta( get_the_ID(), 'meta-text-1', true ); ?></div><?php } ?>
<?php } ?>
<h2><a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>"><?php the_title(); ?></a></h2>
<?php if($qaleb['relate-meta']=='1'){?>
<div class="daat">
<?php if($qaleb['relate-author']=='1'){?><li><i class="fa fa-user" aria-hidden="true"></i> <?php the_author_posts_link(); ?></li><?php } ?>
<?php if($qaleb['relate-time']=='1'){?><li><i class="fa fa-clock" aria-hidden="true"></i> <?php the_time(' d F Y '); ?></li><?php } ?>
<?php if($qaleb['relate-views']=='1'){?><li><i class="fa fa-signal" aria-hidden="true"></i> <?php echo getPostViews(get_the_ID()); ?></li><?php } ?>
<?php if($qaleb['relate-comments']=='1'){?><li><i class="fa fa-comments" aria-hidden="true"></i> <?php comments_popup_link('0', '1 دیدگاه', '% دیدگاه'); ?></li><?php } ?>
</div>
<?php } ?>
</div>
</div>
<?php } wp_reset_postdata(); ?>
<?php }else{ ?>
<?php $tags = wp_get_post_tags($post->ID); if ($tags) { $tag_ids = array(); foreach($tags as $individual_tag) $tag_ids[] = $individual_tag->term_id; $args=array( 'tag__in' => $tag_ids, 'post__not_in' => array($post->ID), 'showposts' => $qaleb['relate-count'], 'caller_get_posts'=>1 ); $my_query = new wp_query($args); if( $my_query->have_posts() ) { echo ''; while ($my_query->have_posts()) { $my_query->the_post(); ?>
<div class="item">
<?php if($qaleb['relate-thumb'] == '1'){?>
<div class="thumb">
<?php if(has_post_thumbnail()){?>
<a href="<?php the_permalink(); ?>"><img src="<?php the_post_thumbnail_url('medium'); ?>" alt="<?php the_title(); ?>"></a>
<?php }else{ ?>
<img src="<?php bloginfo("template_url"); ?>/img/none.png">
<?php } ?>
</div>
<?php } ?>
<div class="det" style="<?php if($qaleb['relate-thumb'] == '1'){?><?php }else{ ?>width:100%;<?php } ?>">
<?php if($qaleb['relate-rott']=='1'){?>
<?php if(get_post_meta( get_the_ID(), 'meta-text-1', true )!=null){ ?><div class="rott"><?php echo get_post_meta( get_the_ID(), 'meta-text-1', true ); ?></div><?php } ?>
<?php } ?>
<h2><a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>"><?php the_title(); ?></a></h2>
<?php if($qaleb['relate-meta']=='1'){?>
<div class="daat">
<?php if($qaleb['relate-author']=='1'){?><li><i class="fa fa-user" aria-hidden="true"></i> <?php the_author_posts_link(); ?></li><?php } ?>
<?php if($qaleb['relate-time']=='1'){?><li><i class="fa fa-clock" aria-hidden="true"></i> <?php the_time(' d F Y '); ?></li><?php } ?>
<?php if($qaleb['relate-views']=='1'){?><li><i class="fa fa-signal" aria-hidden="true"></i> <?php echo getPostViews(get_the_ID()); ?></li><?php } ?>
<?php if($qaleb['relate-comments']=='1'){?><li><i class="fa fa-comments" aria-hidden="true"></i> <?php comments_popup_link('0', '1 دیدگاه', '% دیدگاه'); ?></li><?php } ?>
</div>
<?php } ?>
</div>
</div>
<?php } echo ''; } } wp_reset_query(); ?>
<?php } ?>
</section>
<div class="clearfix"></div>
<?php } ?>