File: /home/rasad/public_html/wp-content/themes/ofogh/inc/block-b/b-1.php
<?php global $qaleb;?>
<?php if($qaleb['block-b-a']=='1'){?>
<section class="block" style="background:<?php echo $qaleb['block-b-a-c']; ?>;">
<div class="container">
<?php if($qaleb['block-b-a-wh']=='1'){?><div class="wh"><?php } ?>
<?php if($qaleb['block-b-a-tiitle']=='1'){?>
<div class="tiitle">
<h3><?php echo $qaleb['block-b-a-title']; ?></h3>
<?php if($qaleb['block-b-a-lt']=='1'){?><a href="<?php echo $qaleb['block-b-a-ml']; ?>"><?php echo $qaleb['block-b-a-mt']; ?></a><?php } ?>
</div>
<?php } ?>
<div class="clearfix"></div>
<div class="block-b<?php if($qaleb['block-b-a-tow']=='1'){?> tow<?php } ?>">
<?php
if($qaleb['block-b-a-content']=='1'){
$arggs = array(
'post_type' => 'post',
'posts_per_page' => $qaleb['block-b-a-count'],
);
}else if($qaleb['block-b-a-content']=='2'){
$arggs = array(
'post_type' => 'post',
'posts_per_page' => $qaleb['block-b-a-count'],
'orderby' => 'rand'
);
}else if($qaleb['block-b-a-content']=='3'){
$arggs = array(
'post_type' => 'post',
'posts_per_page' => $qaleb['block-b-a-count'],
'tax_query' => array(
array(
'taxonomy' => 'category',
'field' => 'term_id',
'terms' => $qaleb['block-b-a-type-select'],
),
),
);
}
query_posts($arggs);
if(have_posts()) : while(have_posts()) : the_post(); ?>
<div class="item">
<div class="thumb">
<?php if(has_post_thumbnail()){?>
<a href="<?php the_permalink(); ?>"><img src="<?php the_post_thumbnail_url('big'); ?>" alt="<?php the_title(); ?>"></a>
<?php }else{ ?>
<img src="<?php bloginfo("template_url"); ?>/img/none.png">
<?php } ?>
</div>
<div class="det">
<?php if($qaleb['block-b-a-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['block-b-a-lead']=='1'){?>
<div class="lead">
<?php if(get_post_meta( get_the_ID(), 'lead', true )!=null){ ?>
<?php echo get_post_meta( get_the_ID(), 'lead', true ); ?>
<?php } else { ?>
<?php the_excerpt(); ?>
<?php } ?>
</div>
<?php } ?>
<div class="daat">
<?php if($qaleb['block-b-a-author']=='1'){?><li><i class="fa fa-user" aria-hidden="true"></i> <?php the_author_posts_link(); ?></li><?php } ?>
<?php if($qaleb['block-b-a-time']=='1'){?><li><i class="fa fa-clock" aria-hidden="true"></i> <?php the_time(' d F Y '); ?></li><?php } ?>
<?php if($qaleb['block-b-a-views']=='1'){?><li><i class="fa fa-signal" aria-hidden="true"></i> <?php echo getPostViews(get_the_ID()); ?></li><?php } ?>
<?php if($qaleb['block-b-a-comments']=='1'){?><li><i class="fa fa-comments" aria-hidden="true"></i> <?php comments_popup_link('0', '1 دیدگاه', '% دیدگاه'); ?></li><?php } ?>
</div>
</div>
</div>
<?php endwhile; endif; wp_reset_query(); ?>
</div>
<?php if($qaleb['block-b-a-wh']=='1'){?></div><?php } ?>
<!----------------------------ردیف دوم---------------------->
<?php if($qaleb['block-b-a-wh']=='1'){?>
<div class="wh"<?php if($qaleb['block-b-a-wh']=='1'){?>style="margin-right:2%;"<?php } ?>>
<div class="tiitle">
<h3><?php echo $qaleb['block-b-a-title-wh']; ?></h3>
<?php if($qaleb['block-b-a-lt-wh']=='1'){?><a href="<?php echo $qaleb['block-b-a-ml-wh']; ?>"><?php echo $qaleb['block-b-a-mt-wh']; ?></a><?php } ?>
</div>
<div class="clearfix"></div>
<div class="block-b<?php if($qaleb['block-b-a-tow']=='1'){?> tow<?php } ?>">
<?php
if($qaleb['block-b-a-content-wh']=='1'){
$arggs = array(
'post_type' => 'post',
'posts_per_page' => $qaleb['block-b-a-count'],
);
}else if($qaleb['block-b-a-content-wh']=='2'){
$arggs = array(
'post_type' => 'post',
'posts_per_page' => $qaleb['block-b-a-count'],
'orderby' => 'rand'
);
}else if($qaleb['block-b-a-content-wh']=='3'){
$arggs = array(
'post_type' => 'post',
'posts_per_page' => $qaleb['block-b-a-count'],
'tax_query' => array(
array(
'taxonomy' => 'category',
'field' => 'term_id',
'terms' => $qaleb['block-b-a-type-select-wh'],
),
),
);
}
query_posts($arggs);
if(have_posts()) : while(have_posts()) : the_post(); ?>
<div class="item">
<div class="thumb">
<?php if(has_post_thumbnail()){?>
<a href="<?php the_permalink(); ?>"><img src="<?php the_post_thumbnail_url('big'); ?>" alt="<?php the_title(); ?>"></a>
<?php }else{ ?>
<img src="<?php bloginfo("template_url"); ?>/img/none.png">
<?php } ?>
</div>
<div class="det">
<?php if($qaleb['block-b-a-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['block-b-a-lead']=='1'){?>
<div class="lead">
<?php if(get_post_meta( get_the_ID(), 'lead', true )!=null){ ?>
<?php echo get_post_meta( get_the_ID(), 'lead', true ); ?>
<?php } else { ?>
<?php the_excerpt(); ?>
<?php } ?>
</div>
<?php } ?>
<div class="daat">
<?php if($qaleb['block-b-a-author']=='1'){?><li><i class="fa fa-user" aria-hidden="true"></i> <?php the_author_posts_link(); ?></li><?php } ?>
<?php if($qaleb['block-b-a-time']=='1'){?><li><i class="fa fa-clock" aria-hidden="true"></i> <?php the_time(' d F Y '); ?></li><?php } ?>
<?php if($qaleb['block-b-a-views']=='1'){?><li><i class="fa fa-signal" aria-hidden="true"></i> <?php echo getPostViews(get_the_ID()); ?></li><?php } ?>
<?php if($qaleb['block-b-a-comments']=='1'){?><li><i class="fa fa-comments" aria-hidden="true"></i> <?php comments_popup_link('0', '1 دیدگاه', '% دیدگاه'); ?></li><?php } ?>
</div>
</div>
</div>
<?php endwhile; endif; wp_reset_query(); ?>
</div>
</div>
<?php } ?>
<!----------------------------ردیف دوم---------------------->
</section>
<div class="clearfix"></div>
<?php } ?>