-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhome.php
78 lines (75 loc) · 2.57 KB
/
home.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
<?php get_header(); ?>
<section id="carousel">
<!-- Carousel
================================================== -->
<div id="post-carousel" class="carousel slide" data-ride="carousel">
<div class="container">
<?php
$args = array(
'posts_per_page' => 5,
'category_name' =>'featured'
);
$slider_query = new WP_Query( $args );
?>
<?php if ( $slider_query->have_posts() ) :
$i = 0;
?>
<ol class="carousel-indicators">
<?php while ( $slider_query->have_posts() ) : $slider_query->the_post();
?>
<li data-target="#post-carousel" data-slide-to="<?php echo $i;?>" class="<?php if ( $i == 0 ) { echo 'active'; } ?>"></li>
<?php
$i++;
endwhile; ?>
</ol>
<?php wp_reset_postdata();?>
<?php endif;?>
<div class="carousel-inner">
<?php if ( $slider_query->have_posts() ) :
$i = 0;
while ( $slider_query->have_posts() ) : $slider_query->the_post();
$i++; ?>
<div class="item <?php if ( $i == 1 ) { echo 'active'; } ?>">
<div class="content">
<h3 class="h1"><?php the_title();?></h3>
<?php the_content();?>
</div>
<div class="image">
<?php the_post_thumbnail('full');?>
</div>
</div>
<?php endwhile;?>
<?php wp_reset_postdata(); ?>
<?php endif;?>
</div> <!--.carousel-inner -->
<a class="left carousel-control" href="#post-carousel" data-slide="prev"><span class="glyphicon glyphicon-chevron-left"></span></a>
<a class="right carousel-control" href="#post-carousel" data-slide="next"><span class="glyphicon glyphicon-chevron-right"></span></a>
</div>
</div><!-- /.carousel -->
</section>
<section id="blog">
<div class="container">
<?php
$args = array(
'posts_per_page' => 2,
);
$blog_query = new WP_Query( $args );
?>
<?php if ( $blog_query->have_posts() ) : while ( $blog_query->have_posts() ) : $blog_query->the_post(); ?>
<article class="blog">
<h3><a href="<?php the_permalink();?>"><?php the_title();?></a></h3>
<?php the_excerpt();?>
<a href="<?php the_permalink();?>" class="btn btn-default">
<?php _e('Read more','stripped');?>
</a>
</article>
<?php endwhile;?>
<?php wp_reset_postdata();?>
<?php else : ?>
<article class="no-blog">
<?php _e('There are no blogs available yet','stripped');?>
</article>
<?php endif;?>
</div>
</section>
<?php get_footer(); ?>