179 lines
6.2 KiB
PHP
Executable File
179 lines
6.2 KiB
PHP
Executable File
<?php
|
|
get_header();
|
|
$slider = array(
|
|
'post_type' => 'post',
|
|
'meta_key' => 'show_in_slider',
|
|
'meta_value' => 'yes',
|
|
'posts_per_page' => -1,
|
|
'ignore_sticky_posts' => true
|
|
);
|
|
$the_query = new WP_Query( $slider );
|
|
if ( $the_query->have_posts() ) :
|
|
?>
|
|
<div class="home-slider">
|
|
<div id="slider" class="sl-slider-wrapper">
|
|
<div class="sl-slider">
|
|
<?php while ( $the_query->have_posts() ) : $the_query->the_post();
|
|
$thumbnail = wp_get_attachment_image_src( get_post_thumbnail_id($post->ID), 'full' );
|
|
$trans = array(
|
|
array('horizontal','-25','-25','2','2'),
|
|
array('vertical','10','-15','1.5','1.5'),
|
|
array('horizontal','3','3','2','1'),
|
|
array('vertical','-25','-25','2','2'),
|
|
array('horizontal','-5','10','2','1')
|
|
);
|
|
$random_key = array_rand($trans,2);
|
|
$arr = $trans[$random_key[0]];
|
|
?>
|
|
<div class="sl-slide" data-orientation="<?php echo $arr[0]; ?>" data-slice1-rotation="<?php echo $arr[1]; ?>" data-slice2-rotation="<?php echo $arr[2]; ?>" data-slice1-scale="<?php echo $arr[3]; ?>" data-slice2-scale="<?php echo $arr[4]; ?>">
|
|
<div class="sl-slide-inner">
|
|
<div class="bg-img" style="background-image: url(<?php echo $thumbnail[0]; ?>); "><a href="<?php the_permalink(); ?>"></a></div>
|
|
<div class="sl-desc">
|
|
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<?php endwhile; ?>
|
|
</div><!-- /sl-slider -->
|
|
<nav id="nav-arrows" class="nav-arrows">
|
|
<span class="nav-arrow-prev">Previous</span>
|
|
<span class="nav-arrow-next">Next</span>
|
|
</nav>
|
|
</div><!-- /slider-wrapper -->
|
|
</div><!-- home-slider -->
|
|
<?php endif; ?>
|
|
<div class="home-box">
|
|
<div class="container">
|
|
<?php
|
|
$blog_args = array(
|
|
'post_type' => 'post',
|
|
'posts_per_page' => 7,
|
|
'paged' => ( get_query_var('paged') ? get_query_var('paged') : 1),
|
|
'ignore_sticky_posts' => true,
|
|
/*
|
|
'meta_key' => 'ex_show_in_homepage',
|
|
'meta_value' => 'yes',
|
|
*/
|
|
);
|
|
$blog = new WP_Query( $blog_args );
|
|
if ( $blog->have_posts() ) :
|
|
?>
|
|
<div class="blog">
|
|
<div class="home-posts">
|
|
<?php
|
|
$i = 0;
|
|
while ( $blog->have_posts() ) : $blog->the_post();
|
|
?>
|
|
<div class="blog-post-box <?php echo 'home-post-'.$i; echo (is_sticky() ? ' sticky-post': ''); ?>">
|
|
<div class="blog-post-feature">
|
|
<?php
|
|
$type = get_post_meta($post->ID,'page_featured_type',true);
|
|
switch ($type) {
|
|
case 'youtube':
|
|
echo '<iframe width="560" height="315" src="http://www.youtube.com/embed/'.get_post_meta( get_the_ID(), 'page_video_id', true ).'?wmode=transparent" frameborder="0" allowfullscreen></iframe>';
|
|
break;
|
|
case 'vimeo':
|
|
echo '<iframe src="http://player.vimeo.com/video/'.get_post_meta( get_the_ID(), 'page_video_id', true ).'?title=0&byline=0&portrait=0&color=03b3fc" width="500" height="338" frameborder="0" webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe>';
|
|
break;
|
|
default:
|
|
$thumbnail = wp_get_attachment_image_src( get_post_thumbnail_id($post->ID), array(600,600) );
|
|
echo '<div class="blog-post-image">
|
|
<a href="'.get_permalink().'" style="background-image: url('.$thumbnail[0].')"></a>';
|
|
echo '<h3><a href="'.get_the_permalink().'">'.get_the_title().'</a></h3>';
|
|
echo '</div>';
|
|
break;
|
|
}
|
|
?>
|
|
</div>
|
|
</div>
|
|
<?php
|
|
$i++;
|
|
endwhile;
|
|
?>
|
|
</div><!-- blog-posts -->
|
|
</div><!-- blog -->
|
|
<?php endif; ?>
|
|
<?php if ( dess_setting('dess_hometext') !='' ) : ?>
|
|
<div class="feature-text-area">
|
|
<h3><?php echo dess_setting('dess_hometext'); ?></h3>
|
|
</div><!-- feature-text-area -->
|
|
<?php endif; ?>
|
|
<?php
|
|
$port_args = array(
|
|
'post_type' => 'post',
|
|
'posts_per_page' => 3,
|
|
'ignore_sticky_posts' => true,
|
|
'paged' => ( get_query_var('paged') ? get_query_var('paged') : 1),
|
|
/*
|
|
'category_name' => 'blog',
|
|
*/
|
|
/*
|
|
'meta_query' => array(
|
|
array(
|
|
'relation' => 'OR',
|
|
array(
|
|
'key' => 'show_in_slider',
|
|
'value' => 'Yes',
|
|
'compare' => '!='
|
|
),
|
|
array(
|
|
'key' => 'show_in_slider',
|
|
'compare' => 'NOT EXISTS'
|
|
)
|
|
),
|
|
'relation' => 'AND',
|
|
array(
|
|
'relation' => 'OR',
|
|
array(
|
|
'key' => 'ex_show_in_homepage',
|
|
'value' => 'Yes',
|
|
'compare' => '!='
|
|
),
|
|
array(
|
|
'key' => 'ex_show_in_homepage',
|
|
'compare' => 'NOT EXISTS'
|
|
)
|
|
),
|
|
),
|
|
*/
|
|
);
|
|
$port_query = new WP_Query( $port_args );
|
|
if ( $port_query->have_posts() ) :
|
|
?>
|
|
<div class="home-featured">
|
|
<?php while ( $port_query->have_posts() ) : $port_query->the_post(); ?>
|
|
<div class="featured-box">
|
|
<div class="port-image">
|
|
<?php
|
|
$type = get_post_meta($post->ID,'page_featured_type',true);
|
|
switch ($type) {
|
|
case 'youtube':
|
|
echo '<iframe src="http://www.youtube.com/embed/'.get_post_meta( get_the_ID(), 'page_video_id', true ).'?wmode=transparent" frameborder="0" allowfullscreen></iframe>';
|
|
break;
|
|
case 'vimeo':
|
|
echo '<iframe src="http://player.vimeo.com/video/'.get_post_meta( get_the_ID(), 'page_video_id', true ).'?title=0&byline=0&portrait=0&color=03b3fc" width="500" height="338" frameborder="0" webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe>';
|
|
break;
|
|
default:
|
|
$thumbnail = wp_get_attachment_image_src( get_post_thumbnail_id($post->ID), array(600,600) );
|
|
echo '<a href="'.get_permalink().'" style="background-image: url('.$thumbnail[0].')"></a>';
|
|
break;
|
|
}
|
|
?>
|
|
</div>
|
|
<div class="port-body">
|
|
<p class="port-date"><?php //the_time('F d, Y'); ?><?php RelativeTime(); ?></p>
|
|
<h3><a href="<?php the_permalink(); ?>"><?php echo the_title(); ?></a></h3>
|
|
<p><?php echo dess_get_excerpt(230); ?></p>
|
|
<a class="read-more" href="<?php the_permalink(); ?>"><?php _e('Read More','CreatorThemeRes-child'); ?></a>
|
|
</div>
|
|
</div>
|
|
<?php endwhile; ?>
|
|
</div><!-- home-portfolio -->
|
|
<?php
|
|
endif;
|
|
?>
|
|
</div><!-- container -->
|
|
</div><!-- home-box -->
|
|
<?php
|
|
get_footer();
|
|
?>
|