File: /home/rasad/domains/rasadeardakan.ir/private_html/wp-content/themes/ofogh/inc/gallery-video.php
<?php global $qaleb;?>
<?php if($qaleb['video-ac']=='1'){?>
<div class="gallery-video" style="background:<?php echo $qaleb['video-i-c']; ?>;">
<div class="container">
<div class="titlee">
<h2><span><?php echo $qaleb['video-span']; ?></span> <?php echo $qaleb['video-title']; ?></h2>
</div>
<?php
if($qaleb['video-h-content']=='1'){
$arggs = array(
'post_type' => 'video',
'posts_per_page' => 1,
);
}else if($qaleb['video-h-content']=='2'){
$arggs = array(
'post_type' => 'video',
'posts_per_page' => 1,
'orderby' => 'rand'
);
}else if($qaleb['video-h-content']=='3'){
$arggs = array(
'post_type' => 'video',
'posts_per_page' => 1,
'tax_query' => array(
array(
'taxonomy' => 'video_category',
'field' => 'term_id',
'terms' => $qaleb['video-h-type-select'],
),
),
);
}
query_posts($arggs);
if(have_posts()) : while(have_posts()) : the_post(); ?>
<div class="video-r">
<div class="thumb">
<?php if(get_post_meta( get_the_ID(), 'video-time', true )!=null){ ?>
<div class="tiime"><?php echo get_post_meta( get_the_ID(), 'video-time', true ); ?></div>
<?php } ?>
<?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 } ?>
<?php if(get_post_meta( get_the_ID(), 'href-link-player', true )!=null){ ?>
<a id="myImg" alt="Snow" class="i-play"><i class="fa fa-play"></i></a>
<?php }else{ ?>
<a href="<?php the_permalink(); ?>" class="i-play"><i class="fa fa-play"></i></a>
<?php } ?>
<div class="det">
<h2><a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>"><?php the_title(); ?></a></h2>
<div class="daat">
<?php if($qaleb['video-i-author']=='1'){?><li><i class="fa fa-user" aria-hidden="true"></i> <?php the_author_posts_link(); ?></li><?php } ?>
<?php if($qaleb['video-i-time']=='1'){?><li><i class="fa fa-clock" aria-hidden="true"></i> <?php the_time(' d F Y '); ?></li><?php } ?>
<?php if($qaleb['video-i-views']=='1'){?><li><i class="fa fa-signal" aria-hidden="true"></i> <?php echo getPostViews(get_the_ID()); ?></li><?php } ?>
<?php if($qaleb['video-i-comments']=='1'){?><li><i class="fa fa-comments" aria-hidden="true"></i> <?php comments_popup_link('0', '1 دیدگاه', '% دیدگاه'); ?></li><?php } ?>
</div>
</div>
</div>
</div>
<?php if(get_post_meta( get_the_ID(), 'href-link-player', true )!=null){ ?>
<div id="myModal" class="modal">
<span class="closee">×</span>
<div class="modal-video">
<video poster="<?php the_post_thumbnail_url('big'); ?>" src="<?php echo get_post_meta( get_the_ID(), 'href-link-player', true ); ?>" data-overlay="1"></video>
</div>
<div id="caption"><?php the_title(); ?></div>
</div>
<?php } ?>
<?php endwhile; endif; wp_reset_query(); ?>
<div class="sb-container video-l">
<?php
if($qaleb['video-h-content']=='1'){
$arggs = array(
'post_type' => 'video',
'offset' => 1,
'posts_per_page' => 7,
);
}else if($qaleb['video-h-content']=='2'){
$arggs = array(
'post_type' => 'video',
'offset' => 1,
'posts_per_page' => 7,
'orderby' => 'rand'
);
}else if($qaleb['video-h-content']=='3'){
$arggs = array(
'post_type' => 'video',
'offset' => 1,
'posts_per_page' => 7,
'tax_query' => array(
array(
'taxonomy' => 'video_category',
'field' => 'term_id',
'terms' => $qaleb['video-h-type-select'],
),
),
);
}
$i = 0;//----namber
query_posts($arggs);
if(have_posts()) : while(have_posts()) : the_post();
$i++;//----namber
?>
<div class="ite">
<div class="ni"><?php echo $i; ?></div><!----namber---->
<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 } ?>
<?php if(get_post_meta( get_the_ID(), 'href-link-player', true )!=null){ ?>
<a id="myImg" alt="Snow" class="i-play"><i class="fa fa-play"></i></a>
<?php }else{ ?>
<a href="<?php the_permalink(); ?>" class="i-play"><i class="fa fa-play"></i></a>
<?php } ?>
</div>
<div class="det">
<h2><a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>"><?php the_title(); ?></a></h2>
<div class="daat">
<?php if($qaleb['video-i-author']=='1'){?><li><i class="fa fa-user" aria-hidden="true"></i> <?php the_author_posts_link(); ?></li><?php } ?>
<?php if($qaleb['video-i-time']=='1'){?><li><i class="fa fa-clock" aria-hidden="true"></i> <?php the_time(' d F Y '); ?></li><?php } ?>
<?php if($qaleb['video-i-views']=='1'){?><li><i class="fa fa-signal" aria-hidden="true"></i> <?php echo getPostViews(get_the_ID()); ?></li><?php } ?>
<?php if($qaleb['video-i-comments']=='1'){?><li><i class="fa fa-comments" aria-hidden="true"></i> <?php comments_popup_link('0', '1 دیدگاه', '% دیدگاه'); ?></li><?php } ?>
</div>
<?php if(get_post_meta( get_the_ID(), 'video-time', true )!=null){ ?>
<div class="tiime"><?php echo get_post_meta( get_the_ID(), 'video-time', true ); ?></div>
<?php } ?>
</div>
</div>
<?php endwhile; endif; wp_reset_query(); ?>
</div></div></div>
<div class="clearfix"></div>
<script>
var modal = document.getElementById("myModal");
var img = document.getElementById("myImg");
var modalImg = document.getElementById("img01");
var captionText = document.getElementById("caption");
img.onclick = function(){
modal.style.display = "block";
modalImg.src = this.src;
captionText.innerHTML = this.alt;
}
var span = document.getElementsByClassName("closee")[0];
span.onclick = function() {
modal.style.display = "none";
}
</script>
<?php } ?>