forked from WPBuddy/largo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
home-part-slider.php
60 lines (60 loc) · 1.92 KB
/
home-part-slider.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
<div id="homepage-slider" class="carousel slide clearfix">
<div class="carousel-inner">
<div class="top-story item active">
<?php
global $ids;
$items = 0;
$topstory = largo_get_featured_posts( array(
'tax_query' => array(
array(
'taxonomy' => 'prominence',
'field' => 'slug',
'terms' => 'top-story'
)
),
'showposts' => 1
) );
if ( $topstory->have_posts() ) :
while ( $topstory->have_posts() ) : $topstory->the_post(); $ids[] = get_the_ID(); ?>
<a href="<?php the_permalink(); ?>"><?php the_post_thumbnail( 'large' ); ?></a>
<div class="carousel-caption">
<h2><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2>
<h5 class="byline"><?php largo_byline(); ?></h5>
<?php largo_excerpt( $post, 4, false ); ?>
</div>
<?php
$items++;
endwhile;
endif; // end more featured posts ?>
</div>
<?php $substories = largo_get_featured_posts( array(
'tax_query' => array(
array(
'taxonomy' => 'prominence',
'field' => 'slug',
'terms' => 'homepage-featured'
)
),
'showposts' => 4,
'post__not_in' => $ids
) );
if ( $substories->have_posts() ) :
while ( $substories->have_posts() ) : $substories->the_post(); $ids[] = get_the_ID(); ?>
<div class="item">
<a href="<?php the_permalink(); ?>"><?php the_post_thumbnail( 'large' ); ?></a>
<div class="carousel-caption">
<h2><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2>
<h5 class="byline"><?php largo_byline(); ?></h5>
<?php largo_excerpt( $post, 4, false ); ?>
</div>
</div>
<?php $items++;
endwhile;
endif; ?>
</div>
<?php if ( $items > 1 ) { ?>
<!-- Carousel nav -->
<a class="carousel-control left" href="#homepage-slider" data-slide="prev">‹</a>
<a class="carousel-control right" href="#homepage-slider" data-slide="next">›</a>
<?php } ?>
</div>