File: /home/rasad/domains/rasadeardakan.ir/private_html/wp-content/themes/ofogh/inc/gallery-photo.php
<?php global $qaleb;?>
<?php if($qaleb['gallery-ac'] == '1'){ ?>
<section class="slider-gallery" style="background:<?php echo $qaleb['gallery-i-c']; ?>;">
<div class="container">
<div class="titlee">
<h2><span><?php echo $qaleb['gallery-span']; ?></span> <?php echo $qaleb['gallery-title']; ?></h2>
</div>
<div class="gallery-r">
<?php
if($qaleb['gallery-content']=='1'){
$arggs = array(
'post_type' => 'gallery',
'posts_per_page' => 1,
);
}else if($qaleb['gallery-content']=='2'){
$arggs = array(
'post_type' => 'gallery',
'posts_per_page' => 1,
'orderby' => 'rand'
);
}else if($qaleb['gallery-content']=='3'){
$arggs = array(
'post_type' => 'gallery',
'posts_per_page' => 1,
'tax_query' => array(
array(
'taxonomy' => 'category',
'field' => 'term_id',
'terms' => $qaleb['gallery-type-select'],
),
),
);
}
query_posts($arggs);
if(have_posts()) : while(have_posts()) : the_post(); ?>
<div class="news-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 class="det">
<h2>
<?php if(get_post_meta( get_the_ID(), 'number-photo', true )!=null){ ?>
<span><?php echo get_post_meta( get_the_ID(), 'number-photo', true ); ?> | </span>
<?php } ?>
<a href="<?php the_permalink(); ?>" alt="<?php the_title(); ?>"><?php the_title(); ?></a></h2>
<div class="daat">
<?php if($qaleb['gallery-i-author']=='1'){?><li><i class="fa fa-user" aria-hidden="true"></i> <?php the_author_posts_link(); ?></li><?php } ?>
<?php if($qaleb['gallery-i-time']=='1'){?><li><i class="fa fa-clock-o" aria-hidden="true"></i> <?php the_time(' d F Y '); ?></li><?php } ?>
<?php if($qaleb['gallery-i-views']=='1'){?><li><i class="fa fa-signal" aria-hidden="true"></i> <?php echo getPostViews(get_the_ID()); ?></li><?php } ?>
<?php if($qaleb['gallery-i-comments']=='1'){?><li><i class="fa fa-comments" aria-hidden="true"></i> <?php comments_popup_link('0', '1 دیدگاه', '% دیدگاه'); ?></li><?php } ?>
</div>
</div>
</div><!-- .news-thumb -->
<?php endwhile; endif; wp_reset_query(); ?>
<?php
if($qaleb['gallery-content']=='1'){
$arggs = array(
'post_type' => 'gallery',
'offset' => 1,
'posts_per_page' => 12,
);
}else if($qaleb['gallery-content']=='2'){
$arggs = array(
'post_type' => 'gallery',
'offset' => 1,
'posts_per_page' => 12,
'orderby' => 'rand'
);
}else if($qaleb['gallery-content']=='3'){
$arggs = array(
'post_type' => 'gallery',
'offset' => 1,
'posts_per_page' => 12,
'tax_query' => array(
array(
'taxonomy' => 'category',
'field' => 'term_id',
'terms' => $qaleb['gallery-type-select'],
),
),
);
}
query_posts($arggs);
if(have_posts()) : while(have_posts()) : the_post(); ?>
<div class="news-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 class="det">
<h2>
<?php if(get_post_meta( get_the_ID(), 'number-photo', true )!=null){ ?>
<span><?php echo get_post_meta( get_the_ID(), 'number-photo', true ); ?> | </span>
<?php } ?>
<a href="<?php the_permalink(); ?>" alt="<?php the_title(); ?>"><?php the_title(); ?></a></h2>
<div class="daat">
<?php if($qaleb['gallery-i-author']=='1'){?><li><i class="fa fa-user" aria-hidden="true"></i> <?php the_author_posts_link(); ?></li><?php } ?>
<?php if($qaleb['gallery-i-time']=='1'){?><li><i class="fa fa-clock-o" aria-hidden="true"></i> <?php the_time(' d F Y '); ?></li><?php } ?>
<?php if($qaleb['gallery-i-views']=='1'){?><li><i class="fa fa-signal" aria-hidden="true"></i> <?php echo getPostViews(get_the_ID()); ?></li><?php } ?>
<?php if($qaleb['gallery-i-comments']=='1'){?><li><i class="fa fa-comments" aria-hidden="true"></i> <?php comments_popup_link('0', '1 دیدگاه', '% دیدگاه'); ?></li><?php } ?>
</div>
</div></div><!-- .news-thumb -->
<?php endwhile; endif; wp_reset_query(); ?>
</div><!-- .gallery-r -->
<ul class="galleryitems">
<?php
if($qaleb['gallery-content']=='1'){
$arggs = array(
'post_type' => 'gallery',
'posts_per_page' => 1,
);
}else if($qaleb['gallery-content']=='2'){
$arggs = array(
'post_type' => 'gallery',
'posts_per_page' => 1,
'orderby' => 'rand'
);
}else if($qaleb['gallery-content']=='3'){
$arggs = array(
'post_type' => 'gallery',
'posts_per_page' => 1,
'tax_query' => array(
array(
'taxonomy' => 'category',
'field' => 'term_id',
'terms' => $qaleb['gallery-type-select'],
),
),
);
}
query_posts($arggs);
if(have_posts()) : while(have_posts()) : the_post(); ?>
<li class="selected"><?php the_title(); ?></li>
<?php endwhile; endif; wp_reset_query(); ?>
<?php
if($qaleb['gallery-content']=='1'){
$arggs = array(
'post_type' => 'gallery',
'offset' => 1,
'posts_per_page' => 12,
);
}else if($qaleb['gallery-content']=='2'){
$arggs = array(
'post_type' => 'gallery',
'offset' => 1,
'posts_per_page' => 12,
'orderby' => 'rand'
);
}else if($qaleb['gallery-content']=='3'){
$arggs = array(
'post_type' => 'gallery',
'offset' => 1,
'posts_per_page' => 12,
'tax_query' => array(
array(
'taxonomy' => 'category',
'field' => 'term_id',
'terms' => $qaleb['gallery-type-select'],
),
),
);
}
query_posts($arggs);
if(have_posts()) : while(have_posts()) : the_post(); ?>
<li><?php the_title(); ?></li>
<?php endwhile; endif; wp_reset_query(); ?>
</ul>
</div>
</section><!-- .slider-gallery -->
<div class="clearfix"></div>
<?php } ?>